本文整理汇总了C#中Vertex.AddEdge方法的典型用法代码示例。如果您正苦于以下问题:C# Vertex.AddEdge方法的具体用法?C# Vertex.AddEdge怎么用?C# Vertex.AddEdge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vertex
的用法示例。
在下文中一共展示了Vertex.AddEdge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Vertex_AddEdge_OneEdge_Success
public void Vertex_AddEdge_OneEdge_Success()
{
// Arrange
var vertex1 = new Vertex<string>("Vertex 1");
var vertex2 = new Vertex<string>("Vertex 2");
var edge = new Edge<string>("Edge 1-2", 100, vertex1, vertex2);
var expected = 1;
// Act
vertex1.AddEdge(edge);
var result = vertex1.EdgeCount();
// Assert
Assert.AreEqual(result, expected);
}
示例2: AddEdge
public virtual void AddEdge( Vertex start, Neighbor theNeighbor )
{
start.AddEdge( theNeighbor );
}
示例3: AddEdge
// Adds an edge without weights if Weighted layer is not present
public void AddEdge( Vertex start, Neighbor theNeighbor )
{
start.AddEdge( theNeighbor );
Vertex end = theNeighbor.neighbor;
end.AddEdge( new Neighbor( start ) );
}