Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
EdgeBundling minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
p-mary committed Nov 30, 2018
1 parent fc1d52f commit 0296bac
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions plugins/general/EdgeBundling/Dijkstra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ void Dijkstra::searchPaths(node ntlp, EdgeStaticProperty<unsigned int> &depth) {
auto ePos = depth.getGraph()->edgePos(edik2tlp[e]);
depth[ePos] += 1;

searchPaths(ndik2tlp[tgt], depth);
if (!resultNodes[tgt])
searchPaths(ndik2tlp[tgt], depth);
}
}
//=============================================================================
Expand All @@ -180,33 +181,22 @@ void Dijkstra::searchPath(node ntlp, vector<node> &vNodes) {
while (ok) {
vNodes.push_back(ndik2tlp[n]);
ok = false;
bool findEdge = false;
edge e;
node tgt;
const vector<edge> &adjEdges = graph.star(n);

for (size_t i = 0; i < adjEdges.size(); ++i) {
e = adjEdges[i];

for (auto e : graph.star(n)) {
// check if that edge does not belong to the shortest path edges
// or if it has already been treated
if (!usedEdges[e] || resultEdges[e])
continue;

tgt = graph.opposite(e, n);
node tgt = graph.opposite(e, n);

if (nodeDistance[tgt] >= nodeDistance[n])
continue;

findEdge = true;
n = tgt;
resultEdges[e] = ok = true;
break;
}

if (findEdge) {
ok = true;
n = tgt; // validEdge.begin()->first;
resultEdges[e] = true;
}
}

if (n != src)
Expand Down

0 comments on commit 0296bac

Please sign in to comment.