Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

GalaxyMultilevel.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 #include <ogdf/basic/GraphList.h>
36 #include <ogdf/basic/List.h>
37 #include <ogdf/basic/tuples.h>
38 
40 class RandomNodeSet;
41 } // namespace ogdf::fast_multipole_embedder
42 
43 namespace ogdf {
44 namespace fast_multipole_embedder {
45 
47 public:
49 
50  struct LevelNodeInfo {
51  float mass;
52  float radius;
55  };
56 
57  struct LevelEdgeInfo {
58  float length;
59  };
60 
61  explicit GalaxyMultilevel(Graph* pGraph) {
62  m_pFinerMultiLevel = nullptr;
63  m_pCoarserMultiLevel = nullptr;
64  m_pGraph = pGraph;
67  for (node v : m_pGraph->nodes) {
68  (*m_pNodeInfo)[v].mass = 1.0;
69  }
70  levelNumber = 0;
71  }
72 
74  m_pCoarserMultiLevel = nullptr;
75  m_pFinerMultiLevel = prev;
77  m_pGraph = nullptr;
78  m_pNodeInfo = nullptr;
79  levelNumber = prev->levelNumber + 1;
80  }
81 
83 
90 };
91 
93 public:
94  struct LevelNodeState {
96  double sysMass;
97  int label;
99  };
100 
101  struct NodeOrderInfo {
103  };
104 
105  GalaxyMultilevel* build(GalaxyMultilevel* pMultiLevel);
106 
107 private:
108  void computeSystemMass();
109  void sortNodesBySystemMass();
110  void createResult(GalaxyMultilevel* pMultiLevelResult);
111  void labelSystem(node u, node v, int d, float df);
112  void labelSystem();
113  Graph* m_pGraph = nullptr;
114  Graph* m_pGraphResult = nullptr;
124  int m_dist = 0;
125 };
126 
128 public:
130  : m_nodeState(nodeState) { }
131 
132  // used for std::sort
135  return m_nodeState[a.theNode].sysMass < m_nodeState[b.theNode].sysMass;
136  }
137 
138 private:
140 };
141 
142 }
143 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::fast_multipole_embedder::GalaxyMultilevel::GalaxyMultilevel
GalaxyMultilevel(Graph *pGraph)
Definition: GalaxyMultilevel.h:61
Graph.h
Includes declaration of graph class.
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_pGraph
Graph * m_pGraph
Definition: GalaxyMultilevel.h:113
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::LevelNodeState::sysMass
double sysMass
Definition: GalaxyMultilevel.h:96
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::LevelNodeState
Definition: GalaxyMultilevel.h:94
ogdf::fast_multipole_embedder::GalaxyMultilevel::m_pCoarserMultiLevel
GalaxyMultilevel * m_pCoarserMultiLevel
Definition: GalaxyMultilevel.h:85
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_pEdgeInfoResult
EdgeArray< GalaxyMultilevel::LevelEdgeInfo > * m_pEdgeInfoResult
Definition: GalaxyMultilevel.h:120
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::LevelNodeState::label
int label
Definition: GalaxyMultilevel.h:97
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_nodeMassOrder
NodeOrderInfo * m_nodeMassOrder
Definition: GalaxyMultilevel.h:122
ogdf::fast_multipole_embedder::GalaxyMultilevel::m_pGraph
Graph * m_pGraph
Definition: GalaxyMultilevel.h:86
ogdf::fast_multipole_embedder::GalaxyMultilevel::LevelNodeInfo::mass
float mass
Definition: GalaxyMultilevel.h:51
ogdf::fast_multipole_embedder::GalaxyMultilevel::GalaxyMultilevel
GalaxyMultilevel(GalaxyMultilevel *prev)
Definition: GalaxyMultilevel.h:73
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_interSystemEdges
List< edge > m_interSystemEdges
Definition: GalaxyMultilevel.h:116
ogdf::fast_multipole_embedder::GalaxyMultilevel::m_pFinerMultiLevel
GalaxyMultilevel * m_pFinerMultiLevel
Definition: GalaxyMultilevel.h:84
ogdf::fast_multipole_embedder::NodeMassComparer::operator()
bool operator()(const GalaxyMultilevelBuilder::NodeOrderInfo &a, const GalaxyMultilevelBuilder::NodeOrderInfo &b) const
Definition: GalaxyMultilevel.h:133
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::build
GalaxyMultilevel * build(GalaxyMultilevel *pMultiLevel)
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::LevelNodeState::edgeLengthFromSun
float edgeLengthFromSun
Definition: GalaxyMultilevel.h:98
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::labelSystem
void labelSystem()
ogdf::fast_multipole_embedder::GalaxyMultilevel
Definition: GalaxyMultilevel.h:46
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::sortNodesBySystemMass
void sortNodesBySystemMass()
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::NodeOrderInfo
Definition: GalaxyMultilevel.h:101
ogdf::fast_multipole_embedder::GalaxyMultilevel::LevelNodeInfo::parent
node parent
Definition: GalaxyMultilevel.h:53
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_nodeState
NodeArray< LevelNodeState > m_nodeState
Definition: GalaxyMultilevel.h:121
ogdf::fast_multipole_embedder::GalaxyMultilevel::m_pEdgeInfo
EdgeArray< LevelEdgeInfo > * m_pEdgeInfo
Definition: GalaxyMultilevel.h:88
ogdf::Graph::nodes
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
Definition: Graph_d.h:932
ogdf::fast_multipole_embedder::GalaxyMultilevel::~GalaxyMultilevel
~GalaxyMultilevel()
Definition: GalaxyMultilevel.h:82
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_pNodeInfo
NodeArray< GalaxyMultilevel::LevelNodeInfo > * m_pNodeInfo
Definition: GalaxyMultilevel.h:117
GraphList.h
Decralation of GraphElement and GraphList classes.
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_pRandomSet
RandomNodeSet * m_pRandomSet
Definition: GalaxyMultilevel.h:123
ogdf::List< Tuple2< node, int > >
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::LevelNodeState::lastVisitor
node lastVisitor
Definition: GalaxyMultilevel.h:95
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_pNodeInfoResult
NodeArray< GalaxyMultilevel::LevelNodeInfo > * m_pNodeInfoResult
Definition: GalaxyMultilevel.h:119
ogdf::fast_multipole_embedder::GalaxyMultilevel::LevelNodeInfo::nearSuns
NearSunList nearSuns
Definition: GalaxyMultilevel.h:54
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_sunNodeList
List< node > m_sunNodeList
Definition: GalaxyMultilevel.h:115
ogdf::fast_multipole_embedder::GalaxyMultilevel::m_pNodeInfo
NodeArray< LevelNodeInfo > * m_pNodeInfo
Definition: GalaxyMultilevel.h:87
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::NodeOrderInfo::theNode
node theNode
Definition: GalaxyMultilevel.h:102
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::createResult
void createResult(GalaxyMultilevel *pMultiLevelResult)
ogdf::fast_multipole_embedder::GalaxyMultilevel::LevelNodeInfo::radius
float radius
Definition: GalaxyMultilevel.h:52
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::computeSystemMass
void computeSystemMass()
ogdf::fast_multipole_embedder::GalaxyMultilevel::LevelNodeInfo
Definition: GalaxyMultilevel.h:50
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_pGraphResult
Graph * m_pGraphResult
Definition: GalaxyMultilevel.h:114
ogdf::fast_multipole_embedder::GalaxyMultilevel::levelNumber
int levelNumber
Definition: GalaxyMultilevel.h:89
List.h
Declaration of doubly linked lists and iterators.
ogdf::fast_multipole_embedder::GalaxyMultilevel::LevelEdgeInfo
Definition: GalaxyMultilevel.h:57
ogdf::fast_multipole_embedder
Definition: ArrayGraph.h:44
ogdf::fast_multipole_embedder::NodeMassComparer
Definition: GalaxyMultilevel.h:127
ogdf::fast_multipole_embedder::NodeMassComparer::NodeMassComparer
NodeMassComparer(const NodeArray< GalaxyMultilevelBuilder::LevelNodeState > &nodeState)
Definition: GalaxyMultilevel.h:129
ogdf::fast_multipole_embedder::NodeMassComparer::m_nodeState
const NodeArray< GalaxyMultilevelBuilder::LevelNodeState > & m_nodeState
Definition: GalaxyMultilevel.h:139
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder
Definition: GalaxyMultilevel.h:92
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_pEdgeInfo
EdgeArray< GalaxyMultilevel::LevelEdgeInfo > * m_pEdgeInfo
Definition: GalaxyMultilevel.h:118
ogdf::fast_multipole_embedder::GalaxyMultilevel::LevelEdgeInfo::length
float length
Definition: GalaxyMultilevel.h:58
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
tuples.h
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.
ogdf::fast_multipole_embedder::RandomNodeSet
utility class to select multiple nodes randomly
Definition: FastUtils.h:187
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::fast_multipole_embedder::GalaxyMultilevelBuilder::m_dist
int m_dist
Definition: GalaxyMultilevel.h:124