Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
OptimalRanking.h
Go to the documentation of this file.
1
33#pragma once
34
35#include <ogdf/basic/Graph.h>
36#include <ogdf/basic/basic.h>
39
40#include <memory>
41
42namespace ogdf {
43
45
77 std::unique_ptr<AcyclicSubgraphModule> m_subgraph; // option for acyclic sugraph
79
80public:
83
84
91 virtual void call(const Graph& G, NodeArray<int>& rank) override;
92
94
99 void call(const Graph& G, const EdgeArray<int>& length, NodeArray<int>& rank);
100
102
108 virtual void call(const Graph& G, const EdgeArray<int>& length, const EdgeArray<int>& cost,
109 NodeArray<int>& rank) override;
110
117
122 bool separateMultiEdges() const { return m_separateMultiEdges; }
123
125 void separateMultiEdges(bool b) { m_separateMultiEdges = b; }
126
133 void setSubgraph(AcyclicSubgraphModule* pSubgraph) { m_subgraph.reset(pSubgraph); }
134
136
137private:
139 void doCall(const Graph& G, NodeArray<int>& rank, EdgeArray<bool>& reversed,
140 const EdgeArray<int>& length, const EdgeArray<int>& cost);
141};
142
143}
Declaration of interface for acyclic subgraph algorithms.
Includes declaration of graph class.
Declaration of interface for ranking algorithms.
Basic declarations, included by all source files.
Base class of algorithms for computing a maximal acyclic subgraph.
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
The optimal ranking algorithm.
virtual void call(const Graph &G, const EdgeArray< int > &length, const EdgeArray< int > &cost, NodeArray< int > &rank) override
Computes a cost-minimal node ranking of G for given edge costs and minimal edge lengths in rank.
bool separateMultiEdges() const
Returns the current setting of option separateMultiEdges.
virtual void call(const Graph &G, NodeArray< int > &rank) override
Computes a node ranking of G in rank.
std::unique_ptr< AcyclicSubgraphModule > m_subgraph
void separateMultiEdges(bool b)
Sets the option separateMultiEdges to b.
void setSubgraph(AcyclicSubgraphModule *pSubgraph)
Sets the module for the computation of the acyclic subgraph.
void call(const Graph &G, const EdgeArray< int > &length, NodeArray< int > &rank)
Computes a node ranking of G with given minimal edge length in rank.
OptimalRanking()
Creates an instance of optimal ranking.
void doCall(const Graph &G, NodeArray< int > &rank, EdgeArray< bool > &reversed, const EdgeArray< int > &length, const EdgeArray< int > &cost)
Implements the algorithm call.
Interface of algorithms for computing a node ranking.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.