AGSol (Art Gallery Solver)
1.0.2
This package contains a software capable of optimally solving the Art Gallery Problem (AGP), one interesting NP-hard problem from the Computational Geometry field. The algorithm implemented in this solution, which can be today considered the state-of-the-art technique on the AGP, can be found in details in the following paper: Davi C. Tozoni, Pedro J. de Rezende, Cid C. de Souza. A Practical Iterative Algorithm for the Art Gallery Problem using Integer Linear Programming
|
Public Member Functions | |
int | solveProblem (PolygonWithHolesExt pol) |
PolygonWithHolesExt | loadPol (char *name) |
void | printPol (PolygonWithHolesExt pol) |
void | writeLog (char *idFile, std::ostream *logFile) |
void | writePartialLog () |
void | writeBestSol (char *idFile, std::ostream *solFile) |
int | getCardinality () |
PolygonSet | getNotCovered () |
PolygonSet | getCovered () |
std::vector< Point > | getGuards () |
std::vector< Point > | getGuardCandidates () |
RT | getAreaMiss () |
int | getIteration () |
bool | isGallerySolved () |
bool | isLoadOk () |
void | setMode (char *mode) |
void | setSolverMode (int mode) |
void | setLogFile (char *nameLog) |
int ArtGallerySolver::getCardinality | ( | ) |
Gets cardinality of the current solution.
PolygonWithHolesExt ArtGallerySolver::loadPol | ( | char * | name | ) |
Loads a polygon from file.
void ArtGallerySolver::printPol | ( | PolygonWithHolesExt | pol | ) |
Prints the polygon in .pol (CGAL) format.
void ArtGallerySolver::setMode | ( | char * | mode | ) |
Sets the discretization technique to be used.
int ArtGallerySolver::solveProblem | ( | PolygonWithHolesExt | pol | ) |
This function implements the full algorithm on a higher level code. The algorithm follows an iterative process of obtaining lower and upper bounds that lead to an optimal solution. These bounds are drawn up through the resolution of instances of the aforementioned AGPW and AGPFC problems using Integer Linear Programming (ILP) techniques.
void ArtGallerySolver::writeBestSol | ( | char * | idFile, |
std::ostream * | solFile | ||
) |
Prints best solution found in file.
void ArtGallerySolver::writeLog | ( | char * | idFile, |
std::ostream * | logFile | ||
) |
Prints information about the solving process in file.
void ArtGallerySolver::writePartialLog | ( | ) |
Prints information about the partial solving process in file.