44 namespace cluster_planarity {
56 double heuristicOEdgeBound=0.3,
57 int heuristicNPermLists=5,
58 int kuratowskiIterations=3,
61 double kuratowskiHigh=0.7,
62 double kuratowskiLow=0.3,
64 double branchingGap=0.4,
65 const char *time=
"00:05:00" );
167 bool m_solByHeuristic;
170 void printGraph(
const Graph &G);
177 return "StdConstraints.txt";
224 virtual bool isCP() = 0;
273 if(m_activeRepairs) {
274 m_repairStat.
push(m_activeRepairs);
284 return ((
double) tempo)/ 100.0;
289 const int m_fastHeuristicRuns;
307 double m_largestConnectionCoeff;
330 m_inactiveVariables.
del(it);
332 m_varCreated[(*it).source][(*it).target] =
true;
337 OGDF_ASSERT(!(m_varCreated[a][b] || m_varCreated[b][a]));
342 m_varCreated[a][b] =
true;
int getNumAddVariables() const
virtual bool isCP()=0
Derives and returns c-planarity property either directly or indirectly from computation results...
int m_nKuratowskiIterations
int getNSubdivisions() const
const Graph * getGraph() const
Returns a pointer to the underlying Graph.
double m_heuristicFractionalBound
virtual double heuristicInitialLowerBound()
The master of the optimization.
const ClusterGraph * m_C
Pointers to the given Clustergraph and underlying Graph are stored.
void setStrongVariableViolation(double d)
Data type for general directed graphs (adjacency list representation).
Declaration and implementation of ArrayBuffer class.
void updateAddedCCons(int n)
bool m_mpHeuristic
Indicates if simple max planar subgraph heuristic should be used to derive lower bound if only root c...
double m_strongConstraintViolation
void setStrongConstraintViolation(double d)
virtual void getCoefficients(abacus::Constraint *con, const List< CPlanarEdgeVar * > &connect, List< double > &coeffs)
writes coefficients of all orig and connect variables in constraint con into emptied list coeffs ...
virtual void nodeDistances(node u, NodeArray< NodeArray< int > > &dist)
double getStrongConstraintViolation() const
double m_kuratowskiBoundHigh
virtual void initializeOptimization() override=0
The default implementation of initializeOptimization() does nothing.
int64_t minutes() const
Returns the currently elapsed time in minutes.
double getDoubleTime(const Stopwatch *act)
void push(E e)
Puts a new element in the buffer.
void setKIterations(int n)
int64_t centiSeconds() const
Returns the currently elapsed time in 1/100-seconds.
int getHeuristicLevel() const
static std::ostream & slout(Level level=Level::Default)
stream for logging-output (global)
virtual Graph * solutionInducedGraph()
Returns the optimal solution induced Clustergraph.
int getHeuristicRuns() const
abacus::StandardPool< abacus::Constraint, abacus::Variable > * getCutConnPool()
Returns cut pool for connectivity.
void updateAddedKCons(int n)
virtual Sub * firstSub()=0
Should return a pointer to the first subproblem of the optimization, i.e., the root node of the enume...
void setNSubdivisions(int n)
the master of the optimization.
void del(iterator it)
Removes it from the list.
abacus::StandardPool< abacus::Constraint, abacus::Variable > * getCutKuraPool()
Returns cut pool for planarity.
void setTimeLimit(const char *s)
void heuristicLevel(int level)
void printMe(std::ostream &out) override
Forms the virtual base class for all possible constraints given in pool format.
bool m_useDefaultCutPool
Defines if the ABACUS default cut pool or the separate Connectivity and Kuratowski constraint pools a...
Representation of clustered graphs.
int nMaxVars() const
Returns the number of variables.
ArrayBuffer< int > m_repairStat
bool m_porta
If set to true, PORTA output is written in a file.
Dynamic arrays indexed with nodes.
virtual bool goodVar(node a, node b)
int getNKuratowskiSupportGraphs() const
double epsilon() const
Returns the objective function coefficient of C-edges.
CP_MasterBase(const ClusterGraph &C, int heuristicLevel=1, int heuristicRuns=2, double heuristicOEdgeBound=0.3, int heuristicNPermLists=5, int kuratowskiIterations=3, int subdivisions=10, int kSupportGraphs=3, double kuratowskiHigh=0.7, double kuratowskiLow=0.3, bool perturbation=false, double branchingGap=0.4, const char *time="00:05:00")
Construction and default values.
Contains logging functionality.
virtual void getConnectionOptimalSolutionEdges(List< NodePair > &edges) const
Returns nodePairs of connecting optimal solution edges in list edges.
virtual double heuristicInitialUpperBound()
virtual CPlanarEdgeVar * createVariable(ListIterator< NodePair > &it)
Variable creation for nodePair.
int getKIterations() const
Doubly linked lists (maintaining the length of the list).
double getKBoundHigh() const
Declaration of graph copy classes.
void setPortaFile(bool b)
If set to true, PORTA output is written in a file.
double m_kuratowskiBoundLow
void setHeuristicFractionalBound(double b)
double m_strongVariableViolation
void setNHeuristicRuns(int n)
abacus::StandardPool< abacus::Constraint, abacus::Variable > * m_cutConnPool
Cut pools for connectivity and Kuratowski constraints.
const char * getStdConstraintsFileName()
The name of the file that contains the standard, i.e., non-cut, constraints (may be deleted by ABACUS...
Copies of graphs supporting edge splitting.
Declaration of the variable class for the Branch&Cut algorithm for the Maximum C-Planar SubGraph prob...
List< NodePair > m_connectionOneEdges
stores optimization success state
Class for the representation of nodes.
Encapsulates a pointer to a list element.
virtual ~CP_MasterBase()
Destruction.
double intGap()
Returns a value that allows to distinguish result values when connection edges (tiny negative cost) a...
double getStrongVariableViolation() const
double getKBoundLow() const
void setMPHeuristic(bool b)
Switches use of lower bound heuristic.
virtual void createInitialVariables(List< CPlanarEdgeVar *> &initVars)=0
All variables that have to be present at start of optimization are created here.
int m_nHeuristicPermutationLists
GraphCopy * m_solutionGraph
const ClusterGraph * getClusterGraph() const
Returns a pointer to the given Clustergraph.
virtual double clusterConnection(cluster c, GraphCopy &GC)
Representation of clusters in a clustered graph.
bool perturbation() const
NodeArray< NodeArray< bool > > m_varCreated
Keeps track of variables that are currently inactive during optimization.
double getHeuristicFractionalBound() const
int addedCConstraints() const
void setNumAddVariables(int i)
virtual void terminateOptimization() override
Function that is invoked at the end of the optimization. Does nothing but output in CP_MasterBase...
int64_t seconds() const
Returns the currently elapsed time in seconds.
void setKBoundHigh(double n)
abacus::StandardPool< abacus::Constraint, abacus::Variable > * m_cutKuraPool
Kuratowski Cuts.
virtual void createCompConnVars(List< CPlanarEdgeVar *> &initVars)
Creates variables for complete connectivity.
void setHeuristicPermutationLists(int n)
void setPertubation(bool b)
void setNKuratowskiSupportGraphs(int n)
int m_nKuratowskiSupportGraphs
Keeps track of created variables.
void clearActiveRepairs()
int64_t hours() const
Returns the currently elapsed time in hours.
void setHeuristicRuns(int n)
int addedKConstraints() const
int numberOfHeuristicPermutationLists() const
bool & useDefaultCutPool()
Returns true if default cut pool is used. Otherwise, separate connectivity and Kuratowski pools are g...
virtual double nextConnectCoeff()
The namespace for all OGDF objects.
void setKBoundLow(double n)
bool getMPHeuristic() const
virtual CPlanarEdgeVar * createVariable(node a, node b)
Variable creation for pair of nodes which is not stored in m_inactiveVariables.
List< NodePair > m_inactiveVariables
Declaration of the master class for the Branch&Cut algorithm for the Maximum C-Planar SubGraph proble...
string * m_maxCpuTime
Time threshold for optimization.
virtual void updateBestSubGraph(List< NodePair > &connection)
Updates the "best" Subgraph m_solutionGraph found so far and fills connection with.
Realizes a stopwatch for measuring elapsed time.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.