def compatible(cluster_a, value_a, cluster_b, value_b):
    """
    Checks compatibility of clusters of variables.
    Compatibility means that values agree on common
    variables.
    """
    for node in list(cluster_a):
        position_a = cluster_a.index(node)
        if node in list(cluster_b):
            position_b = cluster_b.index(node)
            if value_a[position_a] != value_b[position_b]:
                return False
    return True