Interface IGraph<TNodeId, TEdgeId>
- Namespace
- SpatialNET.Network
- Assembly
- SpatialNET.Network.dll
The graph of a network, held and implemented by the host (ADR 0049). The library asks for many ids at once, so that the host can answer each call with one query; the searches are extension methods on this interface (SpatialNET.Network.NetworkAnalysis).
public interface IGraph<TNodeId, TEdgeId> where TNodeId : notnull, IEquatable<TNodeId> where TEdgeId : notnull, IEquatable<TEdgeId>Type Parameters
TNodeId-
The host's node id.
TEdgeId-
The host's edge id.
Extension Methods
Remarks
For the same data the host returns the same order; the results of the searches are deterministic under that condition.
The interface cannot enumerate all nodes on purpose: every search takes its start set from the host.
Exceptions of the host (for example a database that cannot be reached) pass through the searches unchanged.
Methods
GetEdges(IReadOnlyCollection<TNodeId>)
Returns every edge that touches at least one of the given nodes, each edge once, including edges whose other end lies in another shard of the host.
IEnumerable<GraphEdge<TNodeId, TEdgeId>> GetEdges(IReadOnlyCollection<TNodeId> nodeIds)Parameters
nodeIdsIReadOnlyCollection<TNodeId>-
The ids of the nodes, distinct.
Returns
- IEnumerable<GraphEdge<TNodeId, TEdgeId>>
GetNodes(IReadOnlyCollection<TNodeId>)
Returns the nodes with the given ids. Unknown ids are left out.
IEnumerable<GraphNode<TNodeId>> GetNodes(IReadOnlyCollection<TNodeId> ids)Parameters
idsIReadOnlyCollection<TNodeId>-
The ids, distinct.
Returns
- IEnumerable<GraphNode<TNodeId>>