fix 1003, should add bidirectional edge

This commit is contained in:
OliverLew
2018-01-05 16:42:07 +08:00
parent db9d050498
commit 1b6d9cfcd6
+5 -2
View File
@@ -101,9 +101,12 @@ void Read(Graph G)
e->length = length;
e->iter = G->vs[id1].adj;
G->vs[id1].adj = e;
/* The other direction */
e++, i++;
e->id = id1;
e->length = length;
e->iter = G->vs[i].adj;
G->vs[i].adj = e;
e->iter = G->vs[id2].adj;
G->vs[id2].adj = e;
}
}