本文整理汇总了C#中IGraph.GetVertices方法的典型用法代码示例。如果您正苦于以下问题:C# IGraph.GetVertices方法的具体用法?C# IGraph.GetVertices怎么用?C# IGraph.GetVertices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGraph
的用法示例。
在下文中一共展示了IGraph.GetVertices方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GraphMerge
public override void GraphMerge(IGraph graph)
{
graph.GetVertices().ForEach(v =>
this.AddMarking(
(v as MarkingTreeNode).Marking,
(v as TreeGraphNode).Parent != null ? ((v as TreeGraphNode).Parent as TreeGraphNode).Value.ToString() : null,
v.Value.ToString()
)
);
}
示例2: GraphMerge
public virtual void GraphMerge(IGraph graph)
{
graph.GetVertices().ForEach(v => this.AddVertex(v.Value));
graph.GetEdges().ForEach(e => this.AddEdge(e.Vertices[0].Value, e.Vertices[1].Value));
}
示例3: GraphMerge
public override void GraphMerge(IGraph graph)
{
graph.GetVertices().ForEach(v =>
this.AddTreeNode(
v.Value,
(v as TreeGraphNode).Parent != null ? ((v as TreeGraphNode).Parent as TreeGraphNode).Value : null
)
);
}
示例4: CopyTo
public virtual void CopyTo(IGraph graph)
{
var g = graph as UndirectedGraph;
g.edges = new List<IEdge>();
g.vertices = new List<IVertex>();
this.GetVertices().ForEach(v => g.vertices.Add(v.Clone() as IVertex));
this.GetEdges().ForEach(e => g.edges.Add(e.Clone() as IEdge));
graph.GetVertices().ForEach(v => v.Graph = graph);
graph.GetEdges().ForEach(delegate(IEdge e)
{
e.Vertices[0] = graph[e.Vertices[0].Value];
e.Vertices[1] = graph[e.Vertices[1].Value];
e.Graph = graph;
});
//graph.GraphMerge(this);
}