81 return doCall(pr, cc, pCostOrig, pForbiddenOrig, pEdgeSubGraphs, crossingNumber);
103 return call(pr, cc, crossingNumber, pCostOrig, pForbiddenOrig, pEdgeSubGraphs);
124 int& crossingNumber) = 0;
138 if (pCost ==
nullptr) {
141 int crossingNumber = 0;
147 if (pEdgeSubGraphs !=
nullptr) {
148 int subgraphCounter = 0;
149 for (
int i = 0; i < 32; i++) {
150 if (((*pEdgeSubGraphs)[e1] & (1 << i)) != 0
151 && ((*pEdgeSubGraphs)[e2] & (1 << i)) != 0) {
155 crossingNumber += (subgraphCounter * (*pCost)[e1] * (*pCost)[e2]);
157 crossingNumber += (*pCost)[e1] * (*pCost)[e2];
161 return crossingNumber;
Includes declaration of graph class.
Declaration of graph copy classes.
Decralation of GraphElement and GraphList classes.
Declares base class for all module types.
Declares base class for modules with timeout functionality.
Basic declarations, included by all source files.
Base class for crossing minimization algorithms.
static int computeCrossingNumber(GraphCopy &graphCopy, const EdgeArray< int > *pCost, const EdgeArray< uint32_t > *pEdgeSubGraphs)
Computes the (weighted) crossing number of the planarization graphCopy.
CrossingMinimizationModule()
Initializes a crossing minimization module (default constructor).
virtual ~CrossingMinimizationModule()
Destructor.
ReturnType call(PlanRep &pr, int cc, int &crossingNumber, const EdgeArray< int > *pCostOrig=nullptr, const EdgeArray< bool > *pForbiddenOrig=nullptr, const EdgeArray< uint32_t > *pEdgeSubGraphs=nullptr)
Computes a planarized representation of the input graph.
ReturnType operator()(PlanRep &pr, int cc, int &crossingNumber, const EdgeArray< int > *pCostOrig=nullptr, const EdgeArray< bool > *pForbiddenOrig=nullptr, const EdgeArray< uint32_t > *pEdgeSubGraphs=nullptr)
Computes a planarized representation of the input graph.
virtual ReturnType doCall(PlanRep &pr, int cc, const EdgeArray< int > *pCostOrig, const EdgeArray< bool > *pForbiddenOrig, const EdgeArray< uint32_t > *pEdgeSubGraphs, int &crossingNumber)=0
Actual algorithm call that needs to be implemented by derived classes.
virtual CrossingMinimizationModule * clone() const =0
Returns a new instance of the crossing minimization module with the same option settings.
CrossingMinimizationModule(const CrossingMinimizationModule &cmm)
Initializes an crossing minimization module (copy constructor).
Class for the representation of edges.
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
const Graph & original() const
Returns a reference to the original graph.
Copies of graphs supporting edge splitting.
int numberOfNodes() const
Returns the number of nodes in the graph.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
ReturnType
The return type of a module.
Class for the representation of nodes.
Planarized representations (of a connected component) of a graph.
class for timeout funtionality.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
Declaration of memory manager for allocating small pieces of memory.
The namespace for all OGDF objects.