Xavier-MaYiMing / The-ripple-spreading-algorithm-for-the-one-to-all-multi-objective-shortest-path-problem

The ripple-spreading algorithm that determines all Pareto-optimal paths from one node to all other nodes for the multi-objective shortest path problem.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Ripple-Spreading Algorithm for the One-to-all Multi-Objective Shortest Path Problem

Reference: Hu X B, Gu S H, Zhang C, et al. Finding all Pareto optimal paths by simulating ripple relay race in multi-objective networks[J]. Swarm and Evolutionary Computation, 2021, 64: 100908.

The algorithms aims to find all Pareto-optimal paths from one node to all other nodes within a single run.

Variables Meaning
network Dictionary, {node 1: {node 2: [weight 1, weight 2, ...], ...}, ...}
s_network The network described by a crisp weight on which we conduct the ripple relay race
source The source node
nn The number of nodes
nw The number of objectives
neighbor Dictionary, {node1: [the neighbor nodes of node1], ...}
v The ripple-spreading speed (i.e., the minimum length of arcs)
t The simulated time index
nr The number of ripples - 1
epicenter_set List, the epicenter node of the i-th ripple is epicenter_set[i]
path_set List, the path of the i-th ripple from the source node to node i is path_set[i]
radius_set List, the radius of the i-th ripple is radius_set[i]
active_set List, active_set contains all active ripples
objective_set List, the objective value of the traveling path of the i-th ripple is objective_set[i]
Omega Dictionary, Omega[n] = i denotes that ripple i is generated at node n

Example

image

The red number associated with each arc is the first weight, and the green number is the second weight.

if __name__ == '__main__':
    test_network = {
        0: {1: [62, 50], 2: [44, 90], 3: [67, 10]},
        1: {0: [62, 50], 2: [33, 25], 4: [52, 90]},
        2: {0: [44, 90], 1: [33, 25], 3: [32, 10], 4: [52, 40]},
        3: {0: [67, 10], 2: [32, 10], 4: [54, 100]},
        4: {1: [52, 90], 2: [52, 40], 3: [54, 100]},
    }
    source_node = 0
    print(main(test_network, source_node))
Output:
{
    1: [
        {'path': [0, 1], 'objective': [62, 50]}, 
        {'path': [0, 3, 2, 1], 'objective': [132, 45]},
    ], 
    2: [
        {'path': [0, 2], 'objective': [44, 90]}, 
        {'path': [0, 1, 2], 'objective': [95, 75]}, 
        {'path': [0, 3, 2], 'objective': [99, 20]},
    ], 
    3: [{'path': [0, 3], 'objective': [67, 10]}], 
    4: [
        {'path': [0, 2, 4], 'objective': [96, 130]}, 
        {'path': [0, 3, 4], 'objective': [121, 110]}, 
        {'path': [0, 3, 2, 4], 'objective': [151, 60]},
    ]
}

About

The ripple-spreading algorithm that determines all Pareto-optimal paths from one node to all other nodes for the multi-objective shortest path problem.


Languages

Language:Python 100.0%