Closed MvKaio closed 1 month ago
I believe is useful to write a function that, given the instance graph, returns a list of every pair of vertices u
and v
that satisfy the lemma. Are you interested in writing it @lailamvl ? If you're looking into other things it is fine.
One way of writing this function is computing the intervals [l, r]
of the neighborhoods and identifying which pairs do not overlap. This second part can be done with two for loops, or sorting the intervals in non-decreasing order of r
; and then the good pairs for each vertex will form a prefix. The assimptotic complexity is the same, but if there are few good pairs the second option should be faster. I'm also open to discussions about it and think that similar routines will be used in the FPT algorithms.
@perchuts Can you point to the lemma here? I believe its pdf is already in the repository?
yes, i can do it
This was implemented in the integration of the IP and the Crossing Matrix class and in #24 👍
Bira and Perchuts commented about the following lemma:
If
v
andu
are vertices ofB
(the partition we want to order) and the rightmost neighbor ofv
is to the left of the leftmost neighbor ofu
, thenv
comes beforeu
in every optimal ordering.This lemma can be used in the IP Solver to reduce variables.