| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tlp::VectorGraph Class Reference That class provide a simple implementation of graph structure (without subgraphs, observer, metagraph) it enables to obtain very efficient access/modification time. More...
Detailed DescriptionThat class provide a simple implementation of graph structure (without subgraphs, observer, metagraph) it enables to obtain very efficient access/modification time. User can both use tulip iterators or direct vector to access to the graph structure for better performance. To have maximum speedup, that Graph implementation use only vectors, almost all operations are done in constant time (even modification), however since the class use vectors, modification of adjacency can change the ordering of edges around nodes. If you use it only for standard graph operations there is no problem. However if you want to manipulate maps, be aware that a modification can change the graph embedding. EdgeOrdering function can be used to reorder correctly elements when necessary.
Constructor & Destructor Documentation
Member Function DocumentationAdd a new edge between src and tgt and return it.
Add a new node in the graph and return it.
Return a const reference on the vector of adjacent nodes of n. It is the fastest way to access to node adjacency, Iterators are 25% slower.
o(1)
template<typename TYPE >
Create a new node array of type TYPE NodesAttr can be copied in constant time it is just a pointer NodesAttr is not a smart pointer it must be deleted with freeNodesAttribute o(log(number of arrays) + new of a vector<TYPE> of size N)
template<typename TYPE >
Create a new edge array of type TYPE EdgesAttr can be copied in constant time it is just a pointer EdgesAttr is not a smart pointer it must be deleted with freeEdgesAttribute o(log(number of node arrays) + new of a vector<TYPE> of size E)
delete all nodes/edges and Properties of the graph o(N + E + NbProp)
Return the degree of a node o(1)
Delete all edges in the graph.
Delete all nodes in the graph.
Delete an edge in the graph.
Delete all adjacent edges (in/out) of a node.
Delete a node and all its adjacent edges in the graph.
output the graph in a very simple way for debugging
return the position of an edge in the array of edges.
Return a const reference on the vector of edges of the graph It is the fastest way to access to edge adjacency, Iterators are 25% slower.
Return the extremities of an edge (src, target) o(1)
Test if an edge exist between two nodes, in directed mode the orientation is taken into account.
template<typename TYPE >
template<typename TYPE >
Return a Tulip Iterator on edges of the graph.
Return a Tulip Iterator on in edges of the node n.
Return a Tulip Iterator on in nodes of the node n.
Return a Tulip Iterator on adjacent edges of the node n.
Return a Tulip Iterator on adjacent nodes of the node n.
Return a Tulip Iterator on nodes of the graph.
Return the first node of graph (ie first node in the array of nodes) o(1) Return a Tulip Iterator on out edges of the node n.
Return a Tulip Iterator on out nodes of the node n.
Return the in degree of a node o(1)
internal function to test the integrity of the graph
template<typename TYPE >
Return true if n belongs to the graph o(1)
Return true if e belongs to the graph o(1)
template<typename TYPE >
these two function are used internally to insure that property has been allocated in debug mode
return the position of a node in the array of nodes.
Return a const reference on the vector of nodes of the graph It is the fastest way to access to edge adjacency, Iterators are 25% slower.
Return the number of edges in the graph : o(1)
Return the number of nodes in the graph : o(1)
Return the edge at position id in the array of nodes o(1)
Return the node at position id in the array of nodes o(1) return the opposite node of n through edge e o(1)
Return the out degree of a node o(1)
Enables to reserve memory for adjacency nodes Reserving memory before to addEdge enable to reduce the number of vector resizing and then to speed up significantly construction of graphs. o(E + nbEdges)
Enables to reserve memory for adjacency nodes Reserving memory before to addEdge enable to reduce the number of vector resizing and then to speed up significantly construction of graphs. o(E + nbEdges)
Enables to reserve memory for nbEdges Reserving memory before to addEdge enable to reduce the number of vector resizing and then to speed up significantly construction of graphs. o(N + nbNodes)
Enables to reserve memory for nbNodes Reserving memory before to addNode enable to reduce the number of vector resizing and then to speed up significantly construction of graphs. o(N + nbNodes)
Reverse an edge e, source become target and target become soure o(1) Set the ordering of edges around n according to their order in v.
Reconnect the edeg e to have the new given extremities.
change the source of an edge
change the target of an edge
Shuffle the array of graph edges dependant of stl::random_shuffle algorithm (should be o(E))
Shuffle the array of graph nodes dependant of stl::random_shuffle algorithm (should be o(N))
template<typename Compare >
Sort all edges according to comparison functor given in parameter if stable is true a stable sort algorithm is applied Comparison should be an instance of a class wihch implements operator(): dependant of stl::sort and stl::stable_sort algorithm (should be o(E log (E)))
template<typename Compare >
Sort all nodes according to comparison functor given in parameter if stable is true a stable sort algorithm is applied Comparison should be an instance of a class wihch implements operator(): dependant of stl::sort and stl::stable_sort algorithm (should be o(N log (N)))
return the first extremity (considered as source if the graph is directed) of an edge o(1) Return a const reference on the vector of adjacent edges of n. It is the fastest way to access to edge adjacency, Iterators are 25% slower.
o(1)
Swap two nodes in the array of graph nodes o(1)
Swap two edges in the array of graph edge o(1)
swap to edge in the ordered adjacency vector
|
Tulip Software by LaBRI Visualization Team 2001 - 2012 |