21#ifndef _TLPGRAPHTOOLS_H
22#define _TLPGRAPHTOOLS_H
29#include <tulip/tuliphash.h>
30#include <tulip/tulipconf.h>
31#include <tulip/Node.h>
32#include <tulip/Edge.h>
33#include <tulip/MutableContainer.h>
34#include <tulip/StaticProperty.h>
35#include <tulip/Iterator.h>
46enum EDGE_TYPE { UNDIRECTED = 0, INV_DIRECTED = 1, DIRECTED = 2 };
47#define IN_EDGE INV_DIRECTED
48#define OUT_EDGE DIRECTED
49#define INOUT_EDGE UNDIRECTED
51typedef Iterator<node> *(*NodesIteratorFn)(
const tlp::Graph *,
const tlp::node);
52typedef Iterator<edge> *(*EdgesIteratorFn)(
const tlp::Graph *,
const tlp::node);
58TLP_SCOPE NodesIteratorFn getNodesIterator(EDGE_TYPE direction);
64TLP_SCOPE EdgesIteratorFn getEdgesIterator(EDGE_TYPE direction);
74TLP_SCOPE std::vector<std::vector<node>>
75computeCanonicalOrdering(PlanarConMap *, std::vector<edge> *dummyEdges =
nullptr,
81TLP_SCOPE std::vector<node> computeGraphCenters(
Graph *graph);
92TLP_SCOPE
node makeSimpleSource(
Graph *graph);
94TLP_SCOPE
void makeProperDag(
Graph *graph, std::list<node> &addedNodes,
95 tlp_hash_map<edge, edge> &replacedEdges,
135TLP_SCOPE
void bfs(
const Graph *graph,
node root, std::vector<node> &nodes);
143TLP_SCOPE
void bfs(
const Graph *graph, std::vector<node> &nodes);
156TLP_SCOPE
void dfs(
const Graph *graph,
node root, std::vector<node> &nodes);
164TLP_SCOPE
void dfs(
const Graph *graph, std::vector<node> &nodes);
171 unsigned int k, std::map<double, int> &mapping);
178 unsigned int k, std::map<double, int> &mapping);
188 bool *test =
nullptr);
195enum ShortestPathType {
200 AllDirectedPaths = 4,
217TLP_SCOPE
bool selectShortestPaths(
const Graph *
const graph,
node src,
node tgt,
229TLP_SCOPE
void markReachableNodes(
const Graph *graph,
const node startNode,
230 tlp_hash_map<node, bool> &reachables,
unsigned int maxDistance,
231 EDGE_TYPE direction = UNDIRECTED);
233TLP_SCOPE
void computeDijkstra(
const Graph *
const graph,
node src,
234 const EdgeStaticProperty<double> &weights,
235 NodeStaticProperty<double> &nodeDistance, EDGE_TYPE direction,
236 tlp_hash_map<
node, std::list<node>> &ancestors,
237 std::stack<node> *queueNodes =
nullptr,
238 MutableContainer<int> *numberOfPaths =
nullptr);
A graph property that maps a Boolean value to graph elements.
A graph property that maps a double value to graph elements.
A graph property that maps an integer value to graph elements.
Interface all numerical properties. Property values are always returned as double.
PluginProcess subclasses are meant to notify about the progress state of some process (typically a pl...
Interface for Tulip iterators. Allows basic iteration operations only.
The node struct represents a node in a Graph object.