helper.valid_minor¶
-
helper.valid_minor(T, node_set)[source]¶ Helper function for two_tree_traversal.
Determines if node_set produces an s-t oriented sub-tree of T.
Parameters: - T (graph) – The current spanning tree of the PDP instance.
- node_set (set) – Set of nodes to be in sub-tree of T.
Returns: Falseif sub-tree satisfies:- all 3 edges of subset contain s, or
- all 3 edges of subset contain t, or
- subset contains both edges (s, d) and (t, o)
TrueotherwiseReturn type: bool