dyng
DynamicGraphLayout
|
Represents the sequence of states of a dynamic graph. More...
#include <dynamic_graph.h>
Public Member Functions | |
dynamic_graph ()=default | |
Default constructor. | |
node_id | add_node (unsigned time) |
edge_id | add_edge (unsigned time, node_id one, node_id two) |
void | remove_node (unsigned time, node_id id) |
void | remove_edge (unsigned time, edge_id id) |
void | build () |
void | build (std::vector< graph_state > states) |
void | clear () |
Clears all states and queued modifications. | |
std::vector< graph_state > & | states () |
Returns reference to the vector of graph states. More... | |
const std::vector< graph_state > & | states () const |
Returns const reference to the vector of graph states. More... | |
unsigned | node_count () const |
Returns the number of unique nodes in this dynamic graph. More... | |
unsigned | edge_count () const |
Returns the number of unique edges in this dynamic graph. More... | |
Represents the sequence of states of a dynamic graph.
Holds a sequence of modifications applied and builds a sequence of graph states. Also used to access the resulting layout.
(Described in section 6.1.1)
Adds an edge at specified time.
time | Time when to create the edge. When time == 0 the edge counts as a part of the initial state. |
one | One of the nodes the edge connects to. |
two | The other node the edge connects to. |
|
inline |
Adds a node at specified time.
time | Time when to create the node. When time == 0 the node counts as a part of the initial state. |
|
inline |
Builds the sequence of states from modifications queued up until this point. The states can be accessed by the method states().
invalid_graph | If an edge connects to non-existent node or there is an attempt to remove a non-existent node or edge. |
|
inline |
Clears the modification queue and assigns parameter states
as its states.
You can use this if you have a sequence of graph states to setup the dynamic graph instead of having to call a sequence of modifications and then building it with build().
invalid_graph | If an edge connects to non-existent node or there is an attempt to remove a non-existent node or edge. |
|
inline |
Returns the number of unique edges in this dynamic graph.
Can be inaccurate if you add edges in the same state you remove them in. That way the edges don't end up being present in any state but the return value will be greater by that number of edges.
|
inline |
Returns the number of unique nodes in this dynamic graph.
Can be inaccurate if you add nodes in the same state you remove them in. That way the nodes don't end up being present in any state but the return value will be greater by that number of nodes.
|
inline |
Removes an edge at specified time.
time | Time to remove the edge. |
edge | The id of the edge to remove. |
|
inline |
Removes a node at specified time.
time | Time to remove the node. |
node | The id of the node to remove. |
|
inline |
Returns reference to the vector of graph states.
In order for this method to return non-empty vector the build method has to have been called once (with non-empty sequence of modifications).
You can access the resulting sequence of layouts after this dynamic_graph object has been given to a layout object.
You shouldn't use this method to add/remove any elements.
|
inline |
Returns const reference to the vector of graph states.
In order for this method to return non-empty vector the build method has to have been called once (with non-empty sequence of modifications).
You can access the resulting sequence of layouts after this dynamic_graph object has been given to a layout object.