Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

GalaxyMultilevel.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/tuples.h>
39 
40 namespace ogdf {
41 namespace fast_multipole_embedder {
42 
44 {
45 public:
47 
49  {
50  float mass;
51  float radius;
54  };
55 
57  {
58  float length;
59  };
60 
61  explicit GalaxyMultilevel(Graph* pGraph)
62  {
63  m_pFinerMultiLevel = nullptr;
64  m_pCoarserMultiLevel = nullptr;
65  m_pGraph = pGraph;
66  m_pNodeInfo = new NodeArray<LevelNodeInfo>(*m_pGraph);
67  m_pEdgeInfo = new EdgeArray<LevelEdgeInfo>(*m_pGraph);
68  for(node v : m_pGraph->nodes)
69  {
70  (*m_pNodeInfo)[v].mass = 1.0;
71  }
72  levelNumber = 0;
73  }
74 
76  {
77  m_pCoarserMultiLevel = nullptr;
78  m_pFinerMultiLevel = prev;
80  m_pGraph = nullptr;
81  m_pNodeInfo = nullptr;
82  levelNumber = prev->levelNumber + 1;
83  }
84 
86 
93 };
94 
95 
97 {
98 public:
100  {
102  double sysMass;
103  int label;
105  };
106 
108  {
110  };
111 
112  GalaxyMultilevel* build(GalaxyMultilevel* pMultiLevel);
113 
114 private:
115  void computeSystemMass();
116  void sortNodesBySystemMass();
117  void createResult(GalaxyMultilevel* pMultiLevelResult);
118  void labelSystem(node u, node v, int d, float df);
119  void labelSystem();
131  int m_dist;
132 };
133 
134 
136 {
137 public:
138  explicit NodeMassComparer(const NodeArray< GalaxyMultilevelBuilder::LevelNodeState>& nodeState) : m_nodeState(nodeState) { }
139 
140  // used for std::sort
142  {
143  return m_nodeState[a.theNode].sysMass < m_nodeState[b.theNode].sysMass;
144  }
145 
146 private:
148 };
149 
150 }
151 }
Declaration of class GraphAttributes which extends a Graph by additional attributes.
utility class to select multiple nodes randomly
Definition: FastUtils.h:191
NodeArray< GalaxyMultilevel::LevelNodeInfo > * m_pNodeInfoResult
Definition of utility functions for FME layout.
NodeMassComparer(const NodeArray< GalaxyMultilevelBuilder::LevelNodeState > &nodeState)
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:472
bool operator()(const GalaxyMultilevelBuilder::NodeOrderInfo &a, const GalaxyMultilevelBuilder::NodeOrderInfo &b) const
Declaration of class ArrayGraph.
Dynamic arrays indexed with edges.
Definition: EdgeArray.h:112
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:423
NodeArray< GalaxyMultilevel::LevelNodeInfo > * m_pNodeInfo
Class for the representation of nodes.
Definition: Graph_d.h:167
const NodeArray< GalaxyMultilevelBuilder::LevelNodeState > & m_nodeState
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.
EdgeArray< GalaxyMultilevel::LevelEdgeInfo > * m_pEdgeInfoResult
Declaration of simple graph algorithms.
The namespace for all OGDF objects.
EdgeArray< GalaxyMultilevel::LevelEdgeInfo > * m_pEdgeInfo