edge Class Reference

[Index] [Hierarchy] [Headers]


An edge in a graph More...

#include <GTL/edge.h>

Public Members


edge() [public]

Default constructor. Creates an invalid edge. The only way to obtain a valid edge is through graph::new_edge Example:

graph g;
node n1, n2;
edge e;

n1 = g.new_node(); n2 = g.new_node(); e = g.new_edge(n1, n2);

See Also:
graph::new_edge

node source() const [public]

Returns the source node of the edge.

Returns:
source

node target() const [public]

Returns the target node of the edge.

Returns:
target

void reverse() [public]

Changes the direction of this edge.

void change_source(node n) [public]

Makes n the source of this edge. Takes O(1) time.

Parameters:
n new source

void change_target(node n) [public]

Makes n the target of this edge. Takes O(1) time.

Parameters:
n new target

bool is_hidden() const [public]

Returns true iff node is hidden.

Returns:
true iff node is hidden.
See Also:
graph::hide_edge, graph::restore_edge

Kdoc