36 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
44 #define GNMGFID GIntBig
46 #define GNM_EDGE_DIR_BOTH 0
47 #define GNM_EDGE_DIR_SRCTOTGT 1
48 #define GNM_EDGE_DIR_TGTTOSRC 2
50 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
52 typedef std::vector<GNMGFID> GNMVECTOR, *LPGNMVECTOR;
53 typedef const std::vector<GNMGFID> GNMCONSTVECTOR;
54 typedef const std::vector<GNMGFID> *LPGNMCONSTVECTOR;
55 typedef std::pair<GNMGFID, GNMGFID> EDGEVERTEXPAIR;
56 typedef std::vector<EDGEVERTEXPAIR> GNMPATH;
122 virtual void AddEdge(GNMGFID nConFID, GNMGFID nSrcFID, GNMGFID nTgtFID,
123 bool bIsBidir,
double dfCost,
double dfInvCost);
137 virtual void ChangeEdge(GNMGFID nFID,
double dfCost,
double dfInvCost);
197 GNMGFID nEndFID,
size_t nK);
236 const std::map<GNMGFID, GNMStdEdge> &mstEdges,
237 std::map<GNMGFID, GNMGFID> &mnPathTree);
241 const std::map<GNMGFID, GNMStdEdge> &mstEdges);
243 virtual LPGNMCONSTVECTOR GetOutEdges(GNMGFID nFID)
const;
244 virtual GNMGFID GetOppositVertex(GNMGFID nEdgeFID,
245 GNMGFID nVertexFID)
const;
246 virtual void TraceTargets(std::queue<GNMGFID> &vertexQueue,
247 std::set<GNMGFID> &markedVertIds,
248 GNMPATH &connectedIds);
251 std::map<GNMGFID, GNMStdVertex> m_mstVertices;
252 std::map<GNMGFID, GNMStdEdge> m_mstEdges;
The simple graph class, which holds the appropriate for calculations graph in memory (based on STL co...
Definition: gnmgraph.h:90
virtual void DeleteEdge(GNMGFID nConFID)
Delete edge from graph.
virtual void ChangeAllBlockState(bool bBlock=false)
Change all vertices and edges block state.
virtual void ChangeEdge(GNMGFID nFID, double dfCost, double dfInvCost)
Change edge properties.
virtual std::vector< GNMPATH > KShortestPaths(GNMGFID nStartFID, GNMGFID nEndFID, size_t nK)
An implementation of KShortest paths algorithm.
virtual GNMPATH DijkstraShortestPath(GNMGFID nStartFID, GNMGFID nEndFID, const std::map< GNMGFID, GNMStdEdge > &mstEdges)
DijkstraShortestPath.
virtual void AddVertex(GNMGFID nFID)
Add a vertex to the graph.
virtual void DijkstraShortestPathTree(GNMGFID nFID, const std::map< GNMGFID, GNMStdEdge > &mstEdges, std::map< GNMGFID, GNMGFID > &mnPathTree)
Method to create best path tree.
virtual void DeleteVertex(GNMGFID nFID)
Delete vertex from the graph.
virtual void Clear()
Clear.
virtual void AddEdge(GNMGFID nConFID, GNMGFID nSrcFID, GNMGFID nTgtFID, bool bIsBidir, double dfCost, double dfInvCost)
Add an edge to the graph.
virtual GNMPATH ConnectedComponents(const GNMVECTOR &anEmittersIDs)
Search connected components of the network.
virtual bool CheckVertexBlocked(GNMGFID nFID) const
Check if vertex is blocked.
virtual void ChangeBlockState(GNMGFID nFID, bool bBlock)
Change the block state of edge or vertex.
virtual GNMPATH DijkstraShortestPath(GNMGFID nStartFID, GNMGFID nEndFID)
An implementation of Dijkstra shortest path algorithm.
Core portability definitions for CPL.
Edge.
Definition: gnmgraph.h:60
GNMGFID nTgtVertexFID
Target vertex FID.
Definition: gnmgraph.h:62
bool bIsBidir
Whether the edge is bidirectonal.
Definition: gnmgraph.h:63
GNMGFID nSrcVertexFID
Source vertex FID.
Definition: gnmgraph.h:61
double dfInvCost
Inverse cost.
Definition: gnmgraph.h:65
bool bIsBlocked
Whether the edge is blocked.
Definition: gnmgraph.h:66
double dfDirCost
Direct cost.
Definition: gnmgraph.h:64
Vertex.
Definition: gnmgraph.h:71
bool bIsBlocked
Whether the vertex is blocked.
Definition: gnmgraph.h:73
GNMVECTOR anOutEdgeFIDs
TODO.
Definition: gnmgraph.h:72