namespace Netron.Diagramming.Core.Analysis { /// /// This interface describes the from the point of view of graph analysis. /// public interface IGraph { /// /// Get the in-degree of a node, the number of edges for which the node /// is the target. /// /// /// int InDegree(INode node); /// /// Get the out-degree of a node, the number of edges for which the node /// is the source. /// /// /// int OutDegree(INode node); /// /// Get the degree of a node, the number of edges for which a node /// is either the source or the target. /// /// /// int Degree(INode node); /// /// Indicates if the edges of this graph are directed or undirected. /// bool IsDirected { get; } /// /// Returns the nodes for the current page. This is the same as the property except that the return type is /// here rather than type. /// CollectionBase Nodes { get; } /// /// Get the source Node for the given Edge instance. /// /// /// INode FromNode(IEdge edge); /// /// Get the target Node for the given Edge instance. /// /// /// INode ToNode(IEdge edge); /// /// Given an Edge and an incident Node, return the other Node /// connected to the edge. /// /// /// /// INode AdjacentNode(IEdge edge, INode node); /// /// Gets the collection of all adjacent nodes connected to the given node by an /// incoming edge (i.e., all nodes that "point" at this one). /// CollectionBase InNeighbors(INode node); /// /// Gets the collection of adjacent nodes connected to the given node by an /// outgoing edge (i.e., all nodes "pointed" to by this one). /// CollectionBase OutNeighbors(INode node); /// /// Get an iterator over all nodes connected to the given node. /// CollectionBase Neighbors(INode node); /// /// Gets the edges. /// /// The edges. CollectionBase Edges { get; } /// /// Returns the edges connected to the given node. /// /// The node. /// CollectionBase EdgesOf(INode node); /// /// Returns the incoming edges of the given node. /// /// The node. /// CollectionBase InEdges(INode node); /// /// Returns the outgoing edges attached to the given node. /// /// The node. /// CollectionBase OutEdges(INode node); /// /// Gets a spanning tree of the model or graph. /// /// The spanning tree. ITree SpanningTree { get; } /// /// Makes the spanning tree. /// /// The node. void MakeSpanningTree(INode node); /// /// Clears the spanning tree. /// void ClearSpanningTree(); } }