Go to the documentation of this file. 1 #ifndef GRAPH_ANALYSIS_BOOST_GRAPH_DIRECTED_GRAPH_HPP
2 #define GRAPH_ANALYSIS_BOOST_GRAPH_DIRECTED_GRAPH_HPP
4 #include "../Graph.hpp"
5 #include "../BaseGraph.hpp"
6 #include "../boost_graph/ArcIterator.hpp"
7 #include <boost/graph/adjacency_list.hpp>
8 #include <base-logging/Logging.hpp>
10 #include <boost/unordered_map.hpp>
16 namespace boost_graph {
20 typedef boost::bidirectionalS
GType;
25 typedef boost::property< boost::vertex_index_t, std::size_t, Vertex::Ptr>
VProp;
26 typedef boost::property< boost::edge_index_t, std::size_t, Edge::Ptr>
EProp;
28 typedef boost::adjacency_list<VRep, ERep, boost::undirectedS, VProp, EProp>
UndirectedGraph;
33 typedef boost::graph_traits<BidirectionalGraph>::vertices_size_type
VertexIndex;
34 typedef std::pair<VertexIterator, VertexIterator>
VertexRange;
36 typedef boost::graph_traits<BidirectionalGraph>::edge_descriptor
EdgeDescriptor;
38 typedef std::pair<EdgeIterator, EdgeIterator>
EdgeRange;
54 typedef shared_ptr<DirectedGraph>
Ptr;
55 typedef boost::unordered_map<GraphElementId, VertexDescriptor>
VertexMap;
56 typedef boost::unordered_map<GraphElementId, EdgeDescriptor>
EdgeMap;
75 void write(std::ostream& ostream = std::cout)
const;
156 #endif // GRAPH_ANALYSIS_BOOST_DIRECTED_GRAPH_HPP
boost::graph_traits< BidirectionalGraph >::vertex_descriptor VertexDescriptor
Definition: DirectedGraph.hpp:31
std::pair< EdgeIterator, EdgeIterator > EdgeRange
Definition: DirectedGraph.hpp:38
std::pair< AdjacencyIterator, AdjacencyIterator > AdjacencyRange
Definition: DirectedGraph.hpp:41
boost::listS VRep
Definition: DirectedGraph.hpp:22
virtual GraphElementId addVertexInternal(const Vertex::Ptr &vertex)
Add a vertex.
Definition: DirectedGraph.cpp:56
boost::adjacency_list< VRep, ERep, GType, VProp, EProp > BidirectionalGraph
Definition: DirectedGraph.hpp:29
virtual void removeVertexInternal(const Vertex::Ptr &)
Definition: DirectedGraph.cpp:74
shared_ptr< DirectedGraph > Ptr
Definition: DirectedGraph.hpp:54
graph_analysis::EdgeIterator::Ptr getInEdgeIterator(const Vertex::Ptr &vertex) const
Definition: DirectedGraph.cpp:214
std::pair< VertexIterator, VertexIterator > VertexRange
Definition: DirectedGraph.hpp:34
boost::property< boost::edge_index_t, std::size_t, Edge::Ptr > EProp
Definition: DirectedGraph.hpp:26
boost::property< boost::vertex_index_t, std::size_t, Vertex::Ptr > VProp
Definition: DirectedGraph.hpp:25
Definition: ArcIterator.hpp:51
virtual void removeEdgeInternal(const Edge::Ptr &)
Definition: DirectedGraph.cpp:133
Definition: DirectedGraph.hpp:43
virtual ~DirectedGraph()
Definition: DirectedGraph.cpp:41
static std::map< GraphId, GraphElementId > msNewVertexId
Definition: DirectedGraph.hpp:149
void write(std::ostream &ostream=std::cout) const
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
shared_ptr< BaseGraph > Ptr
Definition: BaseGraph.hpp:34
VertexIterator::Ptr getVertexIterator() const
Definition: DirectedGraph.cpp:156
boost::unordered_map< GraphElementId, VertexDescriptor > VertexMap
Definition: DirectedGraph.hpp:55
shared_ptr< Edge > Ptr
Definition: Edge.hpp:21
BaseGraph::Ptr newInstance() const
Definition: DirectedGraph.cpp:25
boost::adjacency_list< VRep, ERep, boost::undirectedS, VProp, EProp > UndirectedGraph
Definition: DirectedGraph.hpp:28
SubGraph::Ptr identifyConnectedComponents(const BaseGraph::Ptr &baseGraph) const
Definition: DirectedGraph.cpp:174
boost::unordered_map< GraphElementId, EdgeDescriptor > EdgeMap
Definition: DirectedGraph.hpp:56
graph_analysis::EdgeIterator::Ptr getOutEdgeIterator(const Vertex::Ptr &vertex) const
Definition: DirectedGraph.cpp:208
boost::vecS ERep
Definition: DirectedGraph.hpp:23
Edge::Ptr getEdge(GraphElementId id) const
Get the edge by id.
Definition: DirectedGraph.cpp:142
boost::graph_traits< BidirectionalGraph >::edge_iterator EdgeIteratorImpl
Definition: DirectedGraph.hpp:37
EdgeDescriptor getEdgeDescriptor(const Edge::Ptr &edge) const
Definition: DirectedGraph.cpp:108
uint32_t GraphElementId
Definition: GraphElement.hpp:21
BaseGraph::Ptr copy() const
Definition: DirectedGraph.cpp:20
std::vector< Edge::Ptr > getEdges(VertexDescriptor source, VertexDescriptor target) const
Definition: DirectedGraph.cpp:220
boost::graph_traits< BidirectionalGraph >::vertices_size_type VertexIndex
Definition: DirectedGraph.hpp:33
SubGraph::Ptr createSubGraph(const BaseGraph::Ptr &baseGraph) const
Definition: DirectedGraph.cpp:198
boost::graph_traits< BidirectionalGraph >::edge_descriptor EdgeDescriptor
Definition: DirectedGraph.hpp:36
shared_ptr< Vertex > Ptr
Definition: Vertex.hpp:22
DirectedGraph()
Definition: DirectedGraph.cpp:30
GraphElementId addEdgeInternal(const Edge::Ptr &edge, GraphElementId sourceVertexId, GraphElementId targetVertexId)
Add an edge.
Definition: DirectedGraph.cpp:121
DirectedGraph::Ptr validateType(const BaseGraph::Ptr &baseGraph) const
Definition: DirectedGraph.cpp:45
boost::graph_traits< BidirectionalGraph >::adjacency_iterator AdjacencyIterator
Definition: DirectedGraph.hpp:40
Definition: TypedGraph.hpp:9
VertexDescriptor getVertexDescriptor(const Vertex::Ptr &vertex) const
Definition: DirectedGraph.cpp:97
EdgeIterator::Ptr getEdgeIterator() const
Definition: DirectedGraph.cpp:162
Vertex::Ptr getVertex(GraphElementId id) const
Get the vertex by id.
Definition: DirectedGraph.cpp:83
boost::bidirectionalS GType
Definition: DirectedGraph.hpp:20
static std::map< GraphId, GraphElementId > msNewEdgeId
Definition: DirectedGraph.hpp:150
shared_ptr< SubGraph > Ptr
Definition: SubGraph.hpp:52
shared_ptr< EdgeIterator > Ptr
Definition: EdgeIterator.hpp:20
shared_ptr< VertexIterator > Ptr
Definition: VertexIterator.hpp:21
EdgeMap mEdgeMap
Definition: DirectedGraph.hpp:147
VertexMap mVertexMap
Definition: DirectedGraph.hpp:148
Definition: ArcIterator.hpp:98
boost::graph_traits< BidirectionalGraph >::vertex_iterator VertexIteratorImpl
Definition: DirectedGraph.hpp:32