Shortest-Path Optimization of Ship Diesel Engine Disassembly and Assembly Based on AND/OR Network
Algorithm 4
Random depth-first search.
Input: a set of nodes in the network : a set of arcs in the network .: cost of arcs ,.: origin node of the shortest path.: destination of the shortest path.: set of nodes that are excluded from the path if contains node .: a given threshold value for choosing the node in branches of the “OR” node.: the maximal number of iterations
Sets: the path sets , in which contains the nodes of the path from node to .: the set of forbidden nodes.: the set of new-added nodes to path .
Output: set of nodes in the shortest path;: the cost of the shortest path .
Process Step 1: initialize , Step 2: while Step 2.1: initialize ,, Step 2.2: while Step 2.2.1: for in : Step 2.2.1.1: select the precursor nodes of , denoted by Step 2.2.1.2: for in : Step 2.2.2.2.1: select (the conflict nodes of ), denoted by Step 2.2.2.2.2: if add to , delete in , add to , else randomly generate a value , if add to , delete the conflict nodes of in , delete the conflict nodes of in , add to , else go to Step 2.2.1 Step 2.3: calculate the cost of arcs among the nodes of Step 2.4: if Step 2.4.1: set Step 2.4.2: set as the best path , Step 3: output and