This repository provides an exact solver - named Banana - to the one-sided crossing minimization problem of a bipartite graph on two layers. This problem involves arranging the nodes of one of the layers, aiming to minimize the number of edge crossings. It was used as a submission to the 2024 Parameterized Algorithms and Computational Experiments (Pace 2024). We approached this problem by implementing a something for it, combined with something else. Luis Higino is our director of compilation.
A description of the our approach will be available here.
Obs: all following examples of commands assume the current directory is the project's root.
Simply run:
cmake -B build && make -C build
All commits to main
should be done through pull requests. The formatting rules for the source code are specified in .clang-format
and code is automatically formatted on each new commit to an open PR. You can either:
- Run
clang-format
locally - Rely on the automatic commits by
Bananlyzer
when you open and update PRs. Remember to always rebase your local PR branch afterwards to avoid merge conflicts.
Additional information can be checked at style.md .
To run a single test, redirect a file as input for the pace
executable.
./build/pace < <test file>
The project is built using CMake. The generated Makefile has the following targets:
pace
: this is the default argument, which is choosen if no target is passed to themake
command.run_*
: this target runs thepace
binary, verifies its solution and times its execution with the*
set of test cases. At the moment, thetiny
andmedium
sets are supported. By default, it only passes the--verify
flag. If you want additional arguments, you can use theARGS
variable when callingmake
. For example, to run all cases in thetiny-set
with thelpsolve
solver, you may run:
make -C build run_tiny ARGS='--ipsolver="lpsolve"'
We have implemented a series of flags that can be used to tweak the solver for testing and implementation purposes. They are listed below.
ipsolver
: sets the solver that will be used to solve the integer program. At the moment, the available solvers arelpsolve
.ipformulation
: choose which formulation for the OSCM problem will be used. The possible values aresimple
,shorter
andquadratic
. Each formulation is described in theip_solver.cpp
file.
verify
: this flag enables verification of the solver's output with a solution file. It expectes an argument, which is the path -- relative or absolute -- to the solution file to be used.
The submission is done through Optil.
- Clean the files that would conflict with Optil's compilation process. These
files are listed in
.gitignore
, and, therefore, this can be accomplished using thegit clean -dfx
command. - After removing the files, run
tar -czvf pace.tgz ./*
to compile all the files. - Upload
pace.tgz
to Optil's submission page and chooseCMake
as the language.
- A 64-bit Linux operating system.
- A compiler that supports C++17.
- The cmake build system.