{"action":"opened","issue":{"url":"https://api.github.com/repos/scala-graph/scala-graph/issues/33","labels_url":"https://api.github.com/repos/scala-graph/scala-graph/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/scala-graph/scala-graph/issues/33/comments","events_url":"https://api.github.com/repos/scala-graph/scala-graph/issues/33/events","html_url":"https://github.com/scala-graph/scala-graph/issues/33","id":69552058,"number":33,"title":"Edges are doubly added to path builder","user":{"login":"Calavoow","id":1932776,"avatar_url":"https://avatars.githubusercontent.com/u/1932776?v=3","gravatar_id":"","url":"https://api.github.com/users/Calavoow","html_url":"https://github.com/Calavoow","followers_url":"https://api.github.com/users/Calavoow/followers","following_url":"https://api.github.com/users/Calavoow/following{/other_user}","gists_url":"https://api.github.com/users/Calavoow/gists{/gist_id}","starred_url":"https://api.github.com/users/Calavoow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Calavoow/subscriptions","organizations_url":"https://api.github.com/users/Calavoow/orgs","repos_url":"https://api.github.com/users/Calavoow/repos","events_url":"https://api.github.com/users/Calavoow/events{/privacy}","received_events_url":"https://api.github.com/users/Calavoow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-20T10:02:07Z","updated_at":"2015-04-20T10:02:07Z","closed_at":null,"body":"I'm using the edges method of a Path to check if two paths are of the same length. However, I noticed that a certain edge occured twice in my path, which should not be possible (as it is a duplicate). It also seemed to traverse the same edge twice in a row.\r\n\r\nThe following minimal code will produce the bug:\r\n```\r\nimport scalax.collection.immutable.Graph\r\nimport scalax.collection.GraphPredef._, scalax.collection.GraphEdge._\r\n\r\nval g = Graph[Int, UnDiEdge](1 ~ 2, 2 ~ 3)\r\nval builder = g.newPathBuilder(g.get(1))\r\nbuilder.add(g.get(2))\r\n\r\nval builder2 = g.newPathBuilder(g.get(3))\r\nbuilder2.add(g.get(2))\r\nval path2 = builder2.result()\r\n\r\nbuilder ++=(path2)\r\nval path = builder.result() //path: g.Path = Path(1, 1~2, 2, 2~3, 3)\r\npath.edges //res3: Traversable[g.EdgeT] = ArrayBuffer(1~2, 2~3, 2~3)\r\n// Should be: ArrayBuffer(1~2, 2~3)\r\n```\r\n\r\nIt seems to be related to the order paths process edges, because this instead does not produce the bug:\r\n```\r\nval g = Graph[Int, UnDiEdge](1 ~ 2, 2 ~ 3)\r\nval builder = g.newPathBuilder(g.get(1))\r\nbuilder.add(g.get(2))\r\n\r\nval builder2 = g.newPathBuilder(g.get(2))\r\nbuilder2.add(g.get(3))\r\nval path2 = builder2.result()\r\n\r\nbuilder ++=(path2)\r\nval path = builder.result() //path: g.Path = Path(1, 1~2, 2, 2~3, 3)\r\npath.edges //res3: Traversable[g.EdgeT] = ArrayBuffer(1~2, 2~3)\r\n// Correct!\r\n```"}}