How To Do All Reformulating Flashcards
Shortest part
Minimise total LENTGH using weights
Then subject to
1) going out and in of start snd end , these must be 1 so one is chosen
2) sum of in - sum of out = 0
Longest path
Maximise distance this time like before
Subject to
- again going in and going out start end must be 1
- in - out = 0
- however must say ones thst csn go in and out , less than equal to one
- and in general all paths must be less than ewual to one
This binds every variable to 1 max and ensures itsnot spam,ed
Maximum flow no indicator !
Why constraint for weight?
Maximise either going out or in (no indicator )
Subject to
- flow in each vertex - flow out = 0
Don’t need for start and end as this is implied
Then need one for Esch direction less than equal to the weight just to let it know
(Forces it be less than equal to the weight of the arc
Matching problem
Maximise all the possible routes from the left
Subject to
- each route going from left summer must be LESS THAN EQUAL TO ONE (this is because the problem is most succeful mathves, it might be a case where one isn’t matched to get max ), so one picked or none
- EACH ROUTE COMING FROM RIGHT too less than equal to one, this ensures two arentpicked to the same
Best case scenario is max possible matching
Allocation problems
Mini sie or maximsie base on question
You want to list all possibilites x weight once (don’t need twice cuz same 5ing)
Subject to
- AS each MUST HAVE A MATCHING (rather than before maybe not), Indicstor is all = 1
- and again do thst two don’t match the same person, go down vertically too
Transportation problem
List every box weight Mini sie
Subject to each iducsot must add ti each row like befor and after