Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

VertexOrder.h
Go to the documentation of this file.
1 
34 #pragma once
35 
36 #include <ogdf/basic/Graph.h>
38 #include <ogdf/basic/List.h>
39 #include <ogdf/basic/basic.h>
40 
41 #include <utility>
42 #include <vector>
43 
44 namespace ogdf {
45 
46 enum class OrderEnum { asc, desc, rnd };
47 enum class MeasureEnum { zero, log, sum, squared };
48 
53 private:
55 
56  using QElement = std::pair<ogdf::node, unsigned int>;
57 
58  std::vector<QElement> vertex_order;
61 
62  void sort();
63 
64  double crossings(int c);
65 
66  void init_all();
67  void init();
68 
69 
70  void init_cr(edge e);
71 
72 public:
74  : ga(_ga), o(_o), m(_m) {
75  //nothing to do
76  }
77 
79  init();
80  List<node> order;
81  for (auto v : vertex_order) {
82  order.pushBack(v.first);
83  }
84  return order;
85  }
86 
88  vertex_order.clear();
89  init_cr(e);
90  List<node> order;
91  for (auto v : vertex_order) {
92  order.pushBack(v.first);
93  }
94  return order;
95  }
96 };
97 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
GraphAttributes.h
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Graph.h
Includes declaration of graph class.
ogdf::CrossingVertexOrder::ga
GraphAttributes ga
Definition: VertexOrder.h:54
ogdf::CrossingVertexOrder::CrossingVertexOrder
CrossingVertexOrder(GraphAttributes &_ga, OrderEnum _o, MeasureEnum _m)
Definition: VertexOrder.h:73
ogdf::CrossingVertexOrder::get_vertex_order
List< node > get_vertex_order()
Definition: VertexOrder.h:78
Minisat::Internal::sort
void sort(T *array, int size, LessThan lt)
Definition: Sort.h:57
ogdf::MeasureEnum::squared
@ squared
ogdf::MeasureEnum::sum
@ sum
ogdf::OrderEnum::rnd
@ rnd
ogdf::CrossingVertexOrder::vertex_order
std::vector< QElement > vertex_order
Definition: VertexOrder.h:58
ogdf::MeasureEnum::log
@ log
ogdf::CrossingVertexOrder::get_vertex_order_by_crossed_edges
List< node > get_vertex_order_by_crossed_edges(edge e)
Definition: VertexOrder.h:87
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::OrderEnum
OrderEnum
Definition: VertexOrder.h:46
ogdf::CrossingVertexOrder::o
OrderEnum o
Definition: VertexOrder.h:59
ogdf::graphics::init
void init()
Definition: graphics.h:450
ogdf::OrderEnum::asc
@ asc
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::MeasureEnum
MeasureEnum
Definition: VertexOrder.h:47
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
List.h
Declaration of doubly linked lists and iterators.
ogdf::CrossingVertexOrder::m
MeasureEnum m
Definition: VertexOrder.h:60
ogdf::MeasureEnum::zero
@ zero
ogdf::CrossingVertexOrder::QElement
std::pair< ogdf::node, unsigned int > QElement
Definition: VertexOrder.h:56
ogdf::OrderEnum::desc
@ desc
ogdf::CrossingVertexOrder
Definition: VertexOrder.h:52
ogdf::List::pushBack
iterator pushBack(const E &x)
Adds element x at the end of the list.
Definition: List.h:1547