Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Analysis/IGraph.cs @ 2875

Last change on this file since 2875 was 2768, checked in by mkommend, 14 years ago

added solution folders and sources for the netron library (ticket #867)

File size: 4.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace Netron.Diagramming.Core.Analysis
6{
7    /// <summary>
8    /// This interface describes the <see cref="Model"/> from the point of view of graph analysis.
9    /// </summary>
10    public interface IGraph
11    {
12        /// <summary>
13        /// Get the in-degree of a node, the number of edges for which the node
14        /// is the target.
15        /// </summary>
16        /// <param name="node"></param>
17        /// <returns></returns>
18        int InDegree(INode node);
19        /// <summary>
20        /// Get the out-degree of a node, the number of edges for which the node
21        /// is the source.
22        /// </summary>
23        /// <param name="node"></param>
24        /// <returns></returns>
25        int OutDegree(INode node);
26        /// <summary>
27        /// Get the degree of a node, the number of edges for which a node
28        /// is either the source or the target.
29        /// </summary>
30        /// <param name="node"></param>
31        /// <returns></returns>
32        int Degree(INode node);
33        /// <summary>
34        /// Indicates if the edges of this graph are directed or undirected.
35        /// </summary>
36        bool IsDirected { get;}
37        /// <summary>
38        /// Returns the nodes for the current page. This is the same as the <see cref="Model.Shapes"/> property except that the return type is
39        /// here <see cref="INode"/> rather than <see cref="IShape"/> type.
40        /// </summary>
41        CollectionBase<INode> Nodes { get;}
42        /// <summary>
43        /// Get the source Node for the given Edge instance.
44        /// </summary>
45        /// <param name="edge"></param>
46        /// <returns></returns>
47        INode FromNode(IEdge edge);
48        /// <summary>
49        /// Get the target Node for the given Edge instance.
50        /// </summary>
51        /// <param name="edge"></param>
52        /// <returns></returns>
53        INode ToNode(IEdge edge);
54        /// <summary>
55        ///  Given an Edge and an incident Node, return the other Node
56        /// connected to the edge.
57        /// </summary>
58        /// <param name="edge"></param>
59        /// <param name="node"></param>
60        /// <returns></returns>
61        INode AdjacentNode(IEdge edge, INode node);
62        /// <summary>
63        /// Gets the collection of all adjacent nodes connected to the given node by an
64        /// incoming edge (i.e., all nodes that "point" at this one).
65        /// </summary>
66        CollectionBase<INode> InNeighbors(INode node);
67        /// <summary>
68        /// Gets the collection of adjacent nodes connected to the given node by an
69        /// outgoing edge (i.e., all nodes "pointed" to by this one).
70        /// </summary>
71        CollectionBase<INode> OutNeighbors(INode node);
72
73        /// <summary>
74        /// Get an iterator over all nodes connected to the given node.
75        /// </summary>
76        CollectionBase<INode> Neighbors(INode node);
77        /// <summary>
78        /// Gets the edges.
79        /// </summary>
80        /// <value>The edges.</value>
81        CollectionBase<IEdge> Edges { get;}
82        /// <summary>
83        /// Returns the edges connected to the given node.
84        /// </summary>
85        /// <param name="node">The node.</param>
86        /// <returns></returns>
87        CollectionBase<IEdge> EdgesOf(INode node);
88
89        /// <summary>
90        /// Returns the incoming edges of the given node.
91        /// </summary>
92        /// <param name="node">The node.</param>
93        /// <returns></returns>
94        CollectionBase<IEdge> InEdges(INode node);
95
96        /// <summary>
97        /// Returns the outgoing edges attached to the given node.
98        /// </summary>
99        /// <param name="node">The node.</param>
100        /// <returns></returns>
101        CollectionBase<IEdge> OutEdges(INode node);
102
103        /// <summary>
104        /// Gets a spanning tree of the model or graph.
105        /// </summary>
106        /// <value>The spanning tree.</value>
107        ITree SpanningTree { get;}
108
109        /// <summary>
110        /// Makes the spanning tree.
111        /// </summary>
112        /// <param name="node">The node.</param>
113        void MakeSpanningTree(INode node);
114
115        /// <summary>
116        /// Clears the spanning tree.
117        /// </summary>
118        void ClearSpanningTree();
119
120
121
122
123
124
125
126    }
127}
Note: See TracBrowser for help on using the repository browser.