Skip to content

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

@Shujee

Description

@Shujee

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions