Struct acyclic_network::Network [] [src]

pub struct Network<N: NodeType, L: Copy + Debug + Send + Sized, EXTID: Copy + Debug + Send + Sized + Ord = ExternalId> { /* fields omitted */ }

A directed, acylic network.

Methods

impl<N: NodeType, L: Copy + Debug + Send + Sized, EXTID: Copy + Debug + Send + Sized + Ord> Network<N, L, EXTID>
[src]

[src]

[src]

[src]

[src]

[src]

[src]

Complexity

O(number of links)

Complexity

O(number of links)

Complexity

O(1)

Removes all outgoing links of node node_idx.

XXX: This can be optimized.

Complexity

O(k), where k is the number of edges of node_idx.

Removes all incoming links to node node_idx.

XXX: This can be optimized.

Removes all links to and from node node_idx.

[src]

Remove the node with index node_idx including all incoming and outgoing links.

Moves the last node in the nodes array into the empty place and rewires all links. As such, this is a quite heavy operation!

Danger!

The external NodeIndex of the last node is changed!

Complexity

Worst case O(e), where e is the total number of edges in the graph.

[src]

Adds a new node to the network with type node_type and the associated id external_node_id. The external_node_id is stored in the node and can be retrieved later on.

Returns a random link between two unconnected nodes, which would not introduce a cycle. Return None is no such exists.

Returns true if the introduction of this directed link would lead towards a cycle.

Remove the link at index link_index.

Remove the first link that matches source_node_idx and target_node_idx. XXX

Trait Implementations

impl<N: Clone + NodeType, L: Clone + Copy + Debug + Send + Sized, EXTID: Clone + Copy + Debug + Send + Sized + Ord> Clone for Network<N, L, EXTID>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<N: Debug + NodeType, L: Debug + Copy + Debug + Send + Sized, EXTID: Debug + Copy + Debug + Send + Sized + Ord> Debug for Network<N, L, EXTID>
[src]

[src]

Formats the value using the given formatter.