Research Article
A Bio-Inspired Method for the Constrained Shortest Path Problem
Algorithm 1
A bioinspired method for the constrained shortest path problem.
// is the distance matrix, represents the edge length from node to node . | // is the cost matrix, represents the edge cost from node to node . | // is the source node, is the sink node | // : represents the increasing times for the segment with flux continuing to grow in the network (growing segment). | // : represents the whose value is beyond the threshold (potential segment). | // is the constraint, is the threshold, is the divisor of punishment | | | | | while do | // The pressure at the ending node | Calculate the pressure of every node using (11) | | // Using (6) | if then | ; //Using (12) | ; | else | ; | end if | if then | | else | | end if | if then | | else | | end if | if judgePath() //To judge wether there is a path, the result is boolean then | = findPath() //Find the path and return. The nodes (important segment) making up the important path are saved. | if calculateCost( //To judge wether the cost of the path is beyond the constraint then | for to (length(paths) − 1) do | | | | | end for | else | | end if | end if | end while |
|