Home | Documentation | Download | Platforms | Projects | Mailing Lists | Version History
Public Member Functions | |
graph () | |
graph (const graph &G) | |
graph (const graph &G, const list< node > &nodes) | |
graph (const graph &G, list< node >::const_iterator it, list< node >::const_iterator end) | |
virtual | ~graph () |
void | make_directed () |
void | make_undirected () |
bool | is_directed () const |
bool | is_undirected () const |
bool | is_bidirected (edge_map< edge > &rev) const |
bool | is_connected () const |
bool | is_acyclic () const |
int | number_of_nodes () const |
int | number_of_edges () const |
node | center () const |
virtual node | new_node () |
virtual edge | new_edge (node s, node t) |
void | del_node (node n) |
void | del_all_nodes () |
void | del_edge (edge e) |
void | del_all_edges () |
void | clear () |
node_iterator | nodes_begin () const |
node_iterator | nodes_end () const |
edge_iterator | edges_begin () const |
edge_iterator | edges_end () const |
list< node > | all_nodes () const |
list< edge > | all_edges () const |
node | choose_node () const |
void | hide_edge (edge e) |
void | restore_edge (edge e) |
list< edge > | hide_node (node n) |
void | restore_node (node n) |
void | induced_subgraph (list< node > &subgraph_nodes) |
void | restore_graph () |
list< edge > | insert_reverse_edges () |
GML_error | load (const string &filename, bool preserve_ids=false) |
GML_error | load (const char *filename, bool preserve_ids=false) |
int | save (const char *filename) const |
void | save (ostream *file=&cout) const |
virtual void | pre_new_node_handler () |
virtual void | post_new_node_handler (node n) |
virtual void | pre_del_node_handler (node n) |
virtual void | post_del_node_handler () |
virtual void | pre_hide_node_handler (node n) |
virtual void | post_hide_node_handler (node n) |
virtual void | pre_restore_node_handler (node n) |
virtual void | post_restore_node_handler (node n) |
virtual void | pre_new_edge_handler (node s, node t) |
virtual void | post_new_edge_handler (edge e) |
virtual void | pre_del_edge_handler (edge e) |
virtual void | post_del_edge_handler (node, node) |
virtual void | pre_hide_edge_handler (edge e) |
virtual void | post_hide_edge_handler (edge e) |
virtual void | pre_restore_edge_handler (edge e) |
virtual void | post_restore_edge_handler (edge e) |
virtual void | pre_clear_handler () |
virtual void | post_clear_handler () |
virtual void | pre_make_directed_handler () |
virtual void | post_make_directed_handler () |
virtual void | pre_make_undirected_handler () |
virtual void | post_make_undirected_handler () |
virtual void | pre_graph_save_handler (ostream *os) const |
virtual void | save_graph_info_handler (ostream *) const |
virtual void | save_node_info_handler (ostream *, node) const |
virtual void | save_edge_info_handler (ostream *, edge) const |
virtual void | after_graph_save_handler (ostream *) const |
virtual void | top_level_key_handler (GML_pair *list) |
virtual void | load_node_info_handler (node n, GML_pair *list) |
virtual void | load_edge_info_handler (edge e, GML_pair *list) |
virtual void | load_graph_info_handler (GML_pair *list) |
A graph G=(V,E) consists of a set of nodes V and a set of edges E , where every edge can be viewed as a (ordered) pair of nodes (u,v) connecting source u with target v . Obviously this implies a direction on the edges, which is why we call these graphs directed (this is the default). A graph can be made undirected by just ignoring the (implicit) direction.
graph::graph | ( | ) |
Generates an empty graph, i.e. without any nodes and any edges.
graph::graph | ( | const graph & | G | ) |
Copy constructor. Please note: This will generate an isomorpic copy of G
. Although this graph will look like G
it is not physically the same. Especially it consists of nodes and edges, which of course have counterparts in G
, but are different. This means that the nodes (edges) in the copy have undefined behaviour if used within a node_map (edge_map ) of the original graph.
<code>G</code> | graph |
virtual graph::~graph | ( | ) | [virtual] |
Destructor. Deletes all nodes and edges.
void graph::make_directed | ( | ) |
Makes graph directed.
void graph::make_undirected | ( | ) |
Makes graph undirected.
bool graph::is_directed | ( | ) | const |
bool graph::is_undirected | ( | ) | const |
bool graph::is_connected | ( | ) | const |
bool graph::is_acyclic | ( | ) | const |
int graph::number_of_nodes | ( | ) | const |
int graph::number_of_edges | ( | ) | const |
node graph::center | ( | ) | const |
void graph::del_node | ( | node | n | ) |
void graph::del_all_nodes | ( | ) |
void graph::del_edge | ( | edge | e | ) |
void graph::del_all_edges | ( | ) |
void graph::clear | ( | ) |
Deletes all nodes and edges, even the hidden ones
node_iterator graph::nodes_begin | ( | ) | const |
node_iterator graph::nodes_end | ( | ) | const |
edge_iterator graph::edges_begin | ( | ) | const |
edge_iterator graph::edges_end | ( | ) | const |
list<node> graph::all_nodes | ( | ) | const |
list<edge> graph::all_edges | ( | ) | const |
node graph::choose_node | ( | ) | const |
void graph::hide_edge | ( | edge | e | ) |
void graph::restore_edge | ( | edge | e | ) |
void graph::restore_node | ( | node | n | ) |
void graph::induced_subgraph | ( | list< node > & | subgraph_nodes | ) |
Hides all nodes not contained in subgraph_nodes
, i.e. (the visible part of) the graph is the induced subgraph with respect to the nodes in subgraph_nodes
. It is allowed to apply this function recursively, i.e. one may call induced_subgraph
on a graph that is already a induced subgraph.
<code>subgraph_nodes</code> | nodes of subgraph. |
void graph::restore_graph | ( | ) |
Restores all hidden nodes and edges This means that, although the nodes and edges got hidden at different times, they will be restored all together.
list<edge> graph::insert_reverse_edges | ( | ) |
GML_error graph::load | ( | const string & | filename, | |
bool | preserve_ids = false | |||
) | [inline] |
Load graph from a file in GML-format. The optional parameter preserve_ids
controls whether to give the nodes the same ids as in the GML file. You can enable this for debugging but you should disable it for final releases since it may make node_map
unecessarily large.
<code>filename</code> | file in GML-format. | |
<code>preserve_ids</code> | if true all the nodes will get the same id as in the GML file. If false (default) the nodes will be numbered consecutively beginning with 0. However the order of the nodes in the GML file will be preserved. |
GML_error graph::load | ( | const char * | filename, | |
bool | preserve_ids = false | |||
) |
Load graph from a file in GML-format. The optional parameter preserve_ids
controls whether to give the nodes the same ids as in the GML file. You can enable this for debugging but you should disable it for final releases since it may make node_map
unecessarily large.
<code>filename</code> | file in GML-format. | |
<code>preserve_ids</code> | if true all the nodes will get the same id as in the GML file. If false (default) the nodes will be numbered consecutively beginning with 0. However the order of the nodes in the GML file will be preserved. |
int graph::save | ( | const char * | filename | ) | const |
void graph::save | ( | ostream * | file = &cout |
) | const |
Saves graph to stream file
in GML-format.
<code>file</code> | output stream defaults to cout. |
virtual void graph::pre_new_node_handler | ( | ) | [inline, virtual] |
Virtual function called before a new node is created; can be redefined in a derived class for customization
virtual void graph::post_new_node_handler | ( | node | n | ) | [inline, virtual] |
Virtual function called after a new node was created; can be redefined in a derived class for customization
<code>n</code> | created node |
virtual void graph::pre_del_node_handler | ( | node | n | ) | [inline, virtual] |
Virtual function called before a node is deleted; can be redefined in a derived class for customization
<code>n</code> | node deleted afterwards |
virtual void graph::post_del_node_handler | ( | ) | [inline, virtual] |
Virtual function called after a node was deleted; can be redefined in a derived class for customization
virtual void graph::pre_hide_node_handler | ( | node | n | ) | [inline, virtual] |
Virtual function called before a node gets hidden; can be redefined in a derived class for customization
<code>n</code> | node to be hidden |
virtual void graph::post_hide_node_handler | ( | node | n | ) | [inline, virtual] |
Virtual function called after a node got hidden; can be redefined in a derived class for customization
<code>n</code> | hidden node |
virtual void graph::pre_restore_node_handler | ( | node | n | ) | [inline, virtual] |
Virtual function called before a node is restored; can be redefined in a derived class for customization
<code>n</code> | node to be restored |
virtual void graph::post_restore_node_handler | ( | node | n | ) | [inline, virtual] |
Virtual function called after a node was restored; can be redefined in a derived class for customization
<code>n</code> | restored node |
Virtual function called before a new edge is inserted; can be redefined in a derived class for customization
<code>s</code> | source of edge created afterwards | |
<code>t</code> | target of edge created afterwards |
virtual void graph::post_new_edge_handler | ( | edge | e | ) | [inline, virtual] |
Virtual function called after a new edge was inserted; can be redefined in a derived class for customization
<code>e</code> | created edge |
virtual void graph::pre_del_edge_handler | ( | edge | e | ) | [inline, virtual] |
Virtual function called before a edge is deleted; can be redefined in a derived class for customization
<code>e</code> | edge to be deleted |
Virtual function called after a edge was deleted; can be redefined in a derived class for customization
virtual void graph::pre_hide_edge_handler | ( | edge | e | ) | [inline, virtual] |
Virtual function called before a edge gets hidden; can be redefined in a derived class for customization
<code>e</code> | edge to be hidden |
virtual void graph::post_hide_edge_handler | ( | edge | e | ) | [inline, virtual] |
Virtual function called after a edge got hidden; can be redefined in a derived class for customization
<code>e</code> | hidden edge |
virtual void graph::pre_restore_edge_handler | ( | edge | e | ) | [inline, virtual] |
Virtual function called before a edge is restored; can be redefined in a derived class for customization
<code>e</code> | edge to be restored |
virtual void graph::post_restore_edge_handler | ( | edge | e | ) | [inline, virtual] |
Virtual function called after a edge was restored; can be redefined in a derived class for customization
<code>e</code> | restored edge |
virtual void graph::pre_clear_handler | ( | ) | [inline, virtual] |
Virtual function called before performing clear; can be redefined in a derived class for customization. Please note: Although nodes and edges are deleted during graph::clear this is not achieved by calling graph::del_node and graph::del_edge, which is why the correspondig handler will not be called.
virtual void graph::post_clear_handler | ( | ) | [inline, virtual] |
Virtual function called after the graph was cleared; can be redefined in a derived class for customization Please note: Although nodes and edges are deleted during graph::clear this is not achieved by calling graph::del_node and graph::del_edge, which is why the correspondig handler will not be called.
virtual void graph::pre_make_directed_handler | ( | ) | [inline, virtual] |
Virtual function called before performing make_directed (only if graph was undirected) can be redefined in a derived class for customization
virtual void graph::post_make_directed_handler | ( | ) | [inline, virtual] |
Virtual function called after performing make_directed; (only if graph was undirected) can be redefined in a derived class for customization
virtual void graph::pre_make_undirected_handler | ( | ) | [inline, virtual] |
Virtual function called before performing make_undirected; (only if graph was directed) can be redefined in a derived class for customization
virtual void graph::post_make_undirected_handler | ( | ) | [inline, virtual] |
Virtual function called after performing make_undirected; (only if graph was directed) can be redefined in a derived class for customization
virtual void graph::pre_graph_save_handler | ( | ostream * | os | ) | const [inline, virtual] |
Called before writing the graph key to os
. This can be used to write top-level keys that should appear before the graph in the file.
<code>os</code> | output stream. |
virtual void graph::save_graph_info_handler | ( | ostream * | ) | const [inline, virtual] |
Called before the closing bracket of the list belonging to the graph key is written. This can be used to write information that belong to the graph, and thus should appear within the list associated with the graph key.
<code>os</code> | output stream. |
virtual void graph::save_node_info_handler | ( | ostream * | , | |
node | ||||
) | const [inline, virtual] |
Called before the closing bracket of the list belonging to the key of node n
is written. This can be used to write information belonging to the node n
and thus should appear within the list associated with this node.
<code>os</code> | output stream. |
virtual void graph::save_edge_info_handler | ( | ostream * | , | |
edge | ||||
) | const [inline, virtual] |
Called before the closing bracket of the list belonging to the key of edge e
is written. This can be used to write information belonging to the edge e
and thus should appear within the list associated with this edge.
<code>os</code> | output stream. |
virtual void graph::after_graph_save_handler | ( | ostream * | ) | const [inline, virtual] |
Called after writing the graph key to os
. This can be used to write top-level keys that should appear after the graph in the file.
<code>os</code> | output stream. |
virtual void graph::top_level_key_handler | ( | GML_pair * | list | ) | [virtual] |
Called after the graph is completely built. The topmost list of key-value-pairs is passed to this handler. NB: This list also contains the graph key, which was used to build the graph.
<code>list</code> | pointer to the list of key-value pairs at top level |
virtual void graph::load_node_info_handler | ( | node | n, | |
GML_pair * | list | |||
) | [virtual] |
virtual void graph::load_edge_info_handler | ( | edge | e, | |
GML_pair * | list | |||
) | [virtual] |
virtual void graph::load_graph_info_handler | ( | GML_pair * | list | ) | [virtual] |
Called after the graph is completely built. The whole list for the graph key used to build this graph is passed to this handler.
<code>list</code> | pointer to the list of key-value-pairs of the graph. |
University of Passau - FMI - Theoretical Computer Science