Hi. I am trying to create a program which would tell me the connection between some equipments in a network. For a example a connection between Switch1 and Switch10. I know that the path from Switch1 to Switch10 goes through some patches and other switches and these switches and patches have connections with some other switches and patches. I hope you get the idea. The connection between every to devices i define it manually. For example Switch1/port1 connects with Patch1/port1, Patch1/port2 connects with Switch2/port1. Having this information I want to determine the path between Switch1 and Switch10 for example. I know that I have to check all the connections for Switch1 with other switches and patches and then for those switches and patches the connections with other switches and patches and so on until one of them connects to Switch10 which is the destination. The idea is how to put this in a code because I have to create arrays of arrays of arrays. Also, every connection between to devices has a connection id, to identify it. At least this is how i see it. Any information and tips about how to do this would be helpful. Thank you.
Jump to Post
Lets see it from an OO point of view. If is a tree what you are describing … You have objects with some properties. Let’s say that one of them is id and of course parent id (for top objects it should be 0) witch is unique. Creating a list …
Jump to Post
A tree structure is probably the wrong way to go about this. The data structure you describe would be more of a graph. Where each node can have 1:n connections to additional nodes. A tree structure is really best suite for parent-child kind of relationships.
All 5 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.