Have a title, provide switch each port to the server MAC address, and show port is linked, to various sort out switch port connection object, such as
Switch port information is as follows:
The graph is: the relationship between switches and server
Switch the port connection object:
Switch 1
Port 1: switch 2; Switch 3 port 2:
Switch 2
Port 1: server 1; Port 2: the server 2; Port 3: switch 1
Switch 3
Port 1: the server 3; Port 2: switch 1
I feel this idea is based on each leaf node of the tree node is connected to infer the location of the nodes in the tree, you think what kind of algorithm is much better, if you can post implementation code to discuss with us