예제 #1
0
        private static IBidirectionalGraph <HierarchicalGraphVertex, HierarchicalGraphEdge> BuildHierarchicalGraph(IUndirectedGraph <Cluster <Variety>, ClusterEdge <Variety> > tree)
        {
            var graph = new BidirectionalGraph <HierarchicalGraphVertex, HierarchicalGraphEdge>();
            var root  = new HierarchicalGraphVertex(0);

            graph.AddVertex(root);
            GenerateHierarchicalVertices(graph, root, tree, null, tree.GetCenter());
            return(graph);
        }
예제 #2
0
파일: GraphService.cs 프로젝트: JRetza/cog
        private static IBidirectionalGraph <HierarchicalGraphVertex, HierarchicalGraphEdge> BuildHierarchicalGraph(IUndirectedGraph <Cluster <Variety>, ClusterEdge <Variety> > tree)
        {
            var graph = new BidirectionalGraph <HierarchicalGraphVertex, HierarchicalGraphEdge>();
            var root  = new HierarchicalGraphVertex(0);

            graph.AddVertex(root);
            if (tree.VertexCount > 2)
            {
                GenerateHierarchicalVertices(graph, root, tree, null, tree.GetCenter());
            }
            else
            {
                foreach (Cluster <Variety> cluster in tree.Vertices)
                {
                    GenerateHierarchicalVertices(graph, root, tree, null, cluster);
                }
            }

            return(graph);
        }
예제 #3
0
 private static IBidirectionalGraph<HierarchicalGraphVertex, HierarchicalGraphEdge> BuildHierarchicalGraph(IUndirectedGraph<Cluster<Variety>, ClusterEdge<Variety>> tree)
 {
     var graph = new BidirectionalGraph<HierarchicalGraphVertex, HierarchicalGraphEdge>();
     var root = new HierarchicalGraphVertex(0);
     graph.AddVertex(root);
     GenerateHierarchicalVertices(graph, root, tree, null, tree.GetCenter());
     return graph;
 }