This directory contains utility scripts for working with topology optimization instances and solutions.
Python implementation of a heuristic algorithm based on generating random regular graphs for topology optimization problems.
Usage:
python heuristic-random-graph.py [options]Credits:
- Implementation by Robert Waniek
- Based on code by Ikki Fujiwara
Use case: Generate heuristic solutions or initial feasible solutions for topology optimization instances.
Converts solution files from the flow-based MIP model format to .gph graph format.
Usage:
python3 convert_sol2gph_flow.py -f <filename><filename>: Solution file (.solformat) from the flow model
Output: Creates a corresponding .gph file representing the solution graph.
Converts solution files from Seidel-based models to .gph graph format.
Usage:
python3 convert_sol2gph_seidel.py -f <filename><filename>: Solution file (.solformat) from either Seidel linear or Seidel quadratic models
Output: Creates a corresponding .gph file representing the solution graph.
Batch conversion script that converts all .sol files in a directory to .gph format using a specified conversion script.
Usage:
./convert_sol2gph.sh <problem_specific_python_script> <directory>Arguments:
<problem_specific_python_script>: Eitherconvert_sol2gph_flow.pyorconvert_sol2gph_seidel.py<directory>: Directory containing.solfiles to convert
Example:
./convert_sol2gph.sh convert_sol2gph_flow.py ../solutions/flow_solutions/Use case: Batch process multiple solutions for faster benchmarking and validation.
Converts graph files with non-consecutive or non-one-starting vertex indices to a standardized format with consecutive indices starting from 1.
Usage:
python fix_indexing.py <input_file> <output_file><input_file>: Edge list graph file with arbitrary vertex indices<output_file>: Output graph file with consecutive indices starting from 1
Use case: The solution checker assumes vertices are labeled from 1 to n consecutively. Use this script to standardize graph files before validation.