GetEdge() 공개 메소드

public GetEdge ( int vertex, int edgeIndex ) : DirectedEdge
vertex int
edgeIndex int
리턴 DirectedEdge
예제 #1
0
        void DFS(int vertex, bool[] mark, DirectedGraph Graph)
        {
            mark[vertex] = true;

            for (int i = 0; i < Graph.GetVertexDegree(vertex); ++i)
                if (!mark[Graph.GetEdge(vertex, i).End])
                    DFS(Graph.GetEdge(vertex, i).End, mark, Graph);

            _topologicalSort.Add(vertex);
        }
예제 #2
0
        void AddStrongConnectedComponent(int vertex, int[] mark, DirectedGraph Graph)
        {
            mark[vertex] = StrongConnectedComponentCount;
            _strongConnectedComponentVertices[StrongConnectedComponentCount].Add(vertex);

            for (int i = 0; i < Graph.GetVertexDegree(vertex); ++i)
                if (mark[Graph.GetEdge(vertex, i).End] == StrongConnectedComponentCount || mark[Graph.GetEdge(vertex, i).End] == -1)
                {
                    _strongConnectedComponentEdges[StrongConnectedComponentCount].Add(Graph.GetEdge(vertex, i).Reverse());
                    if (mark[Graph.GetEdge(vertex, i).End] == -1)
                        AddStrongConnectedComponent(Graph.GetEdge(vertex, i).End, mark, Graph);
                }
        }