A Java simulation that models how a contagion spreads through a hierarchical network.
The simulation starts from a selected node and determines how long it takes for the contagion to reach every connected node in the network.
The network is represented as a tree structure where each connection acts as a possible path for contagion spread.
A
/ \
B C
/ \
D E
Starting Node: C
Time 0 -> C
Time 1 -> A, E
Time 2 -> B
Time 3 -> D
Total Spread Time: 3
- Trees
- Recursion
- Depth First Search (DFS)
- Distance Tracking
- Network Simulations