helper.construct_tour¶
-
helper.construct_tour(H, x_opt, integer=True)[source]¶ Construct tour graph from decision variables from optimization.
Tour graph P will have attribute ‘value’ with decision variable values. Linear programming solutions may have non-integer values in ‘value’. All other solutions will only have ‘value’ of 1.
Parameters: - H (graph) – Request graph of instance.
- x_opt (list) – Optimization model decision variables and values. Represents the edges in the solution set.
- integer (bool) –
Trueif integer programming model.Falseif linear programming model.
Returns: P – PDP tour solution.
Return type: graph