YaccConstructor / QuickGraph

Generic Graph Data Structures and Algorithms for .NET
http://yaccconstructor.github.io/QuickGraph/
Microsoft Public License
523 stars 198 forks source link

UndirectedGraph.ContainsEdge() should be "undirected" #196

Open Shujee opened 4 years ago

Shujee commented 4 years ago

The following test fails:

    [TestMethod]
    public void UndirectednessTest()
    {
      UndirectedGraph<string, TaggedUndirectedEdge<string, int>> graph = new UndirectedGraph<string, TaggedUndirectedEdge<string, int>>();

      graph.AddVertex("A");
      graph.AddVertex("B");

      var Edge = new TaggedUndirectedEdge<string, int>("A", "B", 10);
      graph.AddEdge(Edge);

      Assert.IsTrue(graph.ContainsEdge("A", "B"));
      Assert.IsTrue(graph.ContainsEdge("B", "A"));
    }

It thinks that there is no edge between B and A, even though this is an undirected graph. Or am I missing something?