def alternate(v):
            '''Make v unmatched by alternating the path to the root of its structure tree.'''
            path = alternatingPath(v)
            path.reverse()
            for x,y in pairs(path):
                matching[x] = y
                matching[y] = x
Make v unmatched by alternating the path to the root of its structure tree.
recipes/Python/221251_Maximum_cardinality_matching_general/recipe-221251.py