Skip to content

Commit

Permalink
Exception handled when working with directed graphs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mir Saman Tajbakhsh committed Feb 14, 2015
1 parent b6be992 commit c00b67c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/org/urmiauniversity/it/mst/cpm/CPM.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ public void execute(GraphModel gm, AttributeModel am) {
for (Node vi : nodes) {
for (Node vj : nodes) {
if ((vi != vj) && (getSharedNodes(vi, vj) == k - 1)) {
edges.add(gm.factory().newEdge(vi, vj, 1.0f, false));
if (g.getGraphModel().isDirected()) {
edges.add(gm.factory().newEdge(vi, vj, 1.0f, true));
} else {
edges.add(gm.factory().newEdge(vi, vj, 1.0f, false));
}
}
}
}
Expand Down

0 comments on commit c00b67c

Please sign in to comment.