Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Dart-Free invariant #459

Merged
merged 3 commits into from
May 24, 2024
Merged

Conversation

fsoupimenta
Copy link
Member

Closes #455

Note

In the grinpy library, for free invariants such as Bull-Free, which we already have, there is already a ready-made implementation for checking this condition. However, in the case of Dart-Free, we had to create our own implementation, following the model adopted by grinpy. Here is an example of a method from the library:

def is_bull_free(G):
    # define a bull graph, also known as the graph obtained from the complete graph K_3 by addiing two pendants
    bull = gp.Graph([(0, 1), (0, 2), (1, 2), (1, 3), (2, 4)])

    # enumerate over all possible combinations of 5 vertices contained in G
    for S in set(itertools.combinations(G.nodes(), 5)):
        H = G.subgraph(list(S))
        if gp.is_isomorphic(H, bull):
            return False
    # if the above loop completes, the graph is bull-free
    return True

The same logic was followed, replacing the bull_graph with a dart_graph

@fsoupimenta fsoupimenta force-pushed the 455-checking-for-dart-free-condition branch from a5e6899 to 109cb1d Compare May 8, 2024 12:07
Copy link
Contributor

@atilaajones atilaajones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Dart graph is wrong. See in Wolfram. You also can implement the Dart graph using g6code or matrix.

image

@fsoupimenta fsoupimenta requested review from atilaajones and removed request for atilaajones May 21, 2024 00:24
@fsoupimenta fsoupimenta merged commit 57597d5 into main May 24, 2024
@fsoupimenta fsoupimenta deleted the 455-checking-for-dart-free-condition branch May 24, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checking for dart-free condition
2 participants