





四個column
最左column: single source
左二column: n個node representing n rabbit
右二column: m個node representing m hole
最右column: single sink
Source to each rabbit: edge capacity = 1 such that each rabbit node’s flow is at max 1
Each Rabbit to each hole: edge capacity = 1 if distance <= S, else no edge
Each hole to sink: edge capacity = hole’s capacity such that each hole node’s flow is at max hole’s capacity
得出既max flow 經過某隻兔=隻兔有hole避 else=隻兔gg
Each兔flow去邊個hole = 個隻兔去邊個hole避
Each Hole to sink at max hole capacity = 唔會有超量既兔入個個hole