How to enforce graph continuity constraint?

249 Views Asked by At

I am working on a single source multiple destinations problem formulation using MILP. The network I have designed is as shown in the figure below Graph Network. The objective function is to minimize the total travelling distance from source to all destination nodes which is defined as follows:

$\min \sum_{(i, j)\in N} T_{ij} x_{ij}$

The constraints I have defined are as follows:

$\sum_{i,j\in Edges} x_{ij} = \sum_{j,l\in Edges} x_{jl}$ for all intermediate nodes. It ensures path starts at origin and that each subsequent edge in the path is a continuation from the previous edge.

$\sum_{i,j\in Edges} x_{ij} = 1 $ For farthest destination node from all destinations

$\sum_{i,j\in Edges} x_{ij} >= 1 $ For intermediate destination nodes

$\sum_{i,j\in Edges} x_{ij} = 1$ for i is source node

The output shows discontinuous edges while computing the shortest path for all destinations. For example, O is the source node and A, C, and E. The output shows the edges:

O-C C-E A-B B-A

The solution misses the edge from E-B. What should be the constraint to address this problem. Any help in this regard is appreciated.

1

There are 1 best solutions below

0
On

You are almost there. Think of sending one unit of flow from the source to each of the $d$ destination nodes. You can express the whole system of constraints uniformly as one constraint per node: outflow minus inflow equals $d$ for the source node, $0$ for the intermediate nodes, and $-1$ for the destination nodes.