def get_num_skips(parent, child):
    """
    Get the number of intermediate nodes between a parent and a child.
    """
    if parent == child:
        return 0
    path = parent.get_path(child)
    return len(path) - 1