Menu

#2 DigraphAsMatrix not iterating all edges

open
nobody
None
5
2005-05-06
2005-05-06
Ray Gilbert
No

Fix:

public virtual bool MoveNext()
{

bool flag;
if(v==-1)
v++;
// RG
if(w==graph.NumberOfVertices-1) { v++; w=-
1;}
if(v < graph.NumberOfVertices)
{
for (w++; w < graph.numberOfVertices;
w++)
{
if (graph.matrix[v, w] == null)
{
if(w==graph.NumberOfVertices-1) {
v++; w=-1;}
if(v==graph.NumberOfVertices) break;
continue;
}
flag = true;
return flag;
}
}
w = -1;
flag = false;
return flag;

}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.