21 #ifndef DIKJSTRA_TOOL_H 22 #define DIKJSTRA_TOOL_H 27 #include <tulip/Graph.h> 28 #include <tulip/Vector.h> 29 #include <tulip/LayoutProperty.h> 30 #include <tulip/DoubleProperty.h> 31 #include <tulip/StaticProperty.h> 32 #include <tulip/MutableContainer.h> 39 Dikjstra(
const Graph *
const graph, node src,
const EdgeStaticProperty<double> &weights,
40 NodeStaticProperty<double> &nodeDistance,
41 std::function<Iterator<edge> *(node)> &getFunc);
43 bool searchPaths(node n, BooleanProperty *result);
45 bool searchPath(node n, BooleanProperty *result);
48 void internalSearchPaths(node n, BooleanProperty *result);
50 struct DikjstraElement {
51 DikjstraElement(
const double dist = DBL_MAX,
const node previous = node(),
52 const node n = node())
53 : dist(dist), previous(previous), n(n) {}
54 bool operator==(
const DikjstraElement &b)
const {
57 bool operator!=(
const DikjstraElement &b)
const {
63 std::vector<edge> usedEdge;
66 struct LessDikjstraElement {
67 bool operator()(
const DikjstraElement *
const a,
const DikjstraElement *
const b)
const {
68 if (fabs(a->dist - b->dist) > 1.E-9) {
69 return (a->dist < b->dist);
71 return (a->n.id < b->n.id);
78 MutableContainer<bool> usedEdges;
79 NodeStaticProperty<double> &nodeDistance;