0

Hi,
I am currently developing a program in C++ which detects path to super node from a simple node in a ring type topology. My requirement is that I need to traverse from simple node to super node and highlight all the possible paths which are going to super node. This includes ring topology in between super node and simple node.

I would like to write a recursive function to find the path. Please let me know if anyone has any idea about how to develop recursive function which detects it. I have developed the function but it fails in curtain senarios. I have attached the images for more understanding.

Attachments Expected.JPG 60.63 KB Starting.JPG 56.09 KB
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by abhayj2000
0

I am not using any linked list. I am using following code

ShowConnections(EndNode EndID, PreviousConnected ID)
{
this->GetConnectedObjects(arrConnectedObject);

for (nConnectedPorts = 0; nConnectedPorts < arrConnectedObject.GetSize();nConnectedPorts++)
{
lDataModId = this->myID;
if ( lDataModId == EndID)
{
//Show green Color line
return true;
}
else
{
ShowConnections(EndID,lDataModId )
{
//Show green color line
return true;
}
}
}
return false;
}

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.