Satsuma
a delicious .NET graph library
|
Interface to a read-only path. More...
Public Member Functions | |
int | ArcCount (ArcFilter filter=ArcFilter.All) |
Returns the total number of arcs satisfying a given filter. More... | |
int | ArcCount (Node u, ArcFilter filter=ArcFilter.All) |
Returns the number of arcs adjacent to a specific node satisfying a given filter. More... | |
int | ArcCount (Node u, Node v, ArcFilter filter=ArcFilter.All) |
Returns the number of arcs adjacent to two nodes satisfying a given filter. More... | |
IEnumerable< Arc > | Arcs (ArcFilter filter=ArcFilter.All) |
IEnumerable< Arc > | Arcs (Node u, ArcFilter filter=ArcFilter.All) |
IEnumerable< Arc > | Arcs (Node u, Node v, ArcFilter filter=ArcFilter.All) |
bool | HasArc (Arc arc) |
Returns whether the given arc is contained in the graph. More... | |
bool | HasNode (Node node) |
Returns whether the given node is contained in the graph. More... | |
bool | IsEdge (Arc arc) |
Returns whether the arc is undirected (true ) or directed (false ). More... | |
Arc | NextArc (Node node) |
Returns the arc connecting a node with its successor in the path. More... | |
int | NodeCount () |
Returns the total number of nodes in O(1) time. More... | |
IEnumerable< Node > | Nodes () |
Returns all nodes of the graph. More... | |
Arc | PrevArc (Node node) |
Returns the arc connecting a node with its predecessor in the path. More... | |
Node | U (Arc arc) |
Returns the first node of an arc. Directed arcs point from U to V. More... | |
Node | V (Arc arc) |
Returns the second node of an arc. Directed arcs point from U to V. More... | |
Properties | |
Node | FirstNode [get] |
The first node of the path, or Node.Invalid if the path is empty. More... | |
Node | LastNode [get] |
The last node of the path, or Node.Invalid if the path is empty. More... | |
Interface to a read-only path.
Here path is used in a sense that no nodes may be repeated. The only exception is that the start and end nodes may be equal. In this case, the path is called a cycle if it has at least one arc.
If the path is a cycle with two nodes, then its two arcs may be equal, but this is the only case when arc equality is allowed (in fact, possible).
The path arcs may be undirected or point in any direction (forward/backward).
The Nodes method always returns the nodes in path order.
The length of a path is defined as the number of its arcs. A path is called empty if it has no nodes.
|
inherited |
Returns the total number of arcs satisfying a given filter.
filter | Detailed description: see Arcs(ArcFilter). |
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.CompleteGraph, Satsuma.Subgraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
Returns the number of arcs adjacent to a specific node satisfying a given filter.
filter | Detailed description: see Arcs(Node, ArcFilter). |
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
Returns the number of arcs adjacent to two nodes satisfying a given filter.
filter | Detailed description: see Arcs(Node, Node, ArcFilter). |
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.CompleteGraph, Satsuma.Subgraph, Satsuma.Matching, Satsuma.ContractedGraph, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
Returns all arcs of the graph satisfying a given filter.
filter | Cannot be ArcType.Forward/ArcType.Backward.
|
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
Returns all arcs adjacent to a specific node satisfying a given filter.
filter |
|
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.Matching, Satsuma.ContractedGraph, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
Returns all arcs adjacent to two nodes satisfying a given filter.
filter |
|
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
|
inherited |
Returns whether the given arc is contained in the graph.
Must return the same value as Arcs().Contains
in all implementations, but faster if possible.
true
may be returned for arcs coming from another graph as well, if those arcs encapsulate an identifier which is valid for this graph, too. Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.CompleteGraph, Satsuma.Subgraph, Satsuma.Matching, Satsuma.ContractedGraph, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
|
inherited |
Returns whether the given node is contained in the graph.
Must return the same value as Nodes().Contains
in all implementations, but faster if possible.
true
may be returned for nodes coming from another graph as well, if those nodes encapsulate an identifier which is valid for this graph, too. Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.CompleteGraph, Satsuma.Subgraph, Satsuma.Matching, Satsuma.ContractedGraph, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
|
inherited |
Returns whether the arc is undirected (true
) or directed (false
).
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
Returns the arc connecting a node with its successor in the path.
Returns Arc.Invalid if the node is not on the path or has no successor. If the path is a cycle, then each node has a successor.
Implemented in Satsuma.PathGraph, and Satsuma.Path.
|
inherited |
Returns the total number of nodes in O(1) time.
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.CompleteGraph, Satsuma.Subgraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
|
inherited |
Returns all nodes of the graph.
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
Returns the arc connecting a node with its predecessor in the path.
Returns Arc.Invalid if the node is not on the path or has no predecessor. If the path is a cycle, then each node has a predecessor.
Implemented in Satsuma.PathGraph, and Satsuma.Path.
Returns the first node of an arc. Directed arcs point from U to V.
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
Returns the second node of an arc. Directed arcs point from U to V.
Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.
|
get |
The first node of the path, or Node.Invalid if the path is empty.
|
get |
The last node of the path, or Node.Invalid if the path is empty.
Equals FirstNode if the path is a cycle.