Network Problems as LPs Flashcards
Formulating shortest path
- Define all variables forwards and backwards (total = 2* number of arcs)
- Discard from these unneeded variables (variables that flow into source and out of sink)
- With remaining variables write the objective function with the arc length the coefficient of the variables (minimise)
- Write constraints (“subject to “).
For source vertices all arcs leaving =0
For sink all vertices all arcs entering = 0
For all other vertices all arcs coming into point are positive. All arcs leaving point are negative. (Make sure not to include the unnecessary arcs). These are =0
Formulating the longest path (direction given)
- Define all variables forwards and backwards (total = number of arcs) - coz direction given
- Discard from these unneeded variables (variables that flow into source and out of sink)- NONE in this case coz direction given
- With remaining variables write the objective function with the arc length the coefficient of the variables (maximise)
- Write constraints (“subject to “).
For source vertices all arcs leaving =0
For sink all vertices all arcs entering = 0
For all other vertices all arcs coming into point are positive. All arcs leaving point are negative. (Make sure not to include the unnecessary arcs). These are =0 - Because is a longest path question need to write contract of every variable being less than or equal to 1, otherwise the variables would be infinity
Formulating maximum flow
- Define variables - IN FLOW NO INDICATOR VARIABLES- variables hold value of arc weight
- Remove unnecessary variables
- Write expression for objective function (maximise) only the arcs leaving the source
- Write down constraints for each vertex =0, will not be an equation for sink
- Because is a maximum problem, each variables needs to be less than or equal to arc weight
Formulating matching problems
Aim: to get each one from each set to match with another 1 from each set
1. All variables are indicator variables, each variable is just an arc presented
2. Objective function is maximise all variables
3. Place constraints on each vertices to be less than or equal to 1( cos could be zero in case that no one matches sadly) BOTH SETS INCLUDED
Formulating allocation problems (minimise)
- All variables are indicator variables, each variable is just an arc presented
- Objective function is minimise all variables, with arc weight as coefficient
- Place constraints on each vertices to be equal to 1- BOTH SETS INCLUDED
Formulating transportation problems
- Variables are indicator variables
- Set up objective function with aim to minimise
- Set up constraints with equal sign
Shortest path summary
Longest path summary
Maximum flow summary
Maximal matching
Allocation problem minimum costs summary
Transportation problem minimum cost