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

Add cut/separator tests #2536

Open
vtraag opened this issue Mar 18, 2024 · 3 comments
Open

Add cut/separator tests #2536

vtraag opened this issue Mar 18, 2024 · 3 comments
Labels
good first issue Candidates for first-time contributors who are already familiar with C

Comments

@vtraag
Copy link
Member

vtraag commented Mar 18, 2024

We need tests that double check cut results. In particular, tests should check (1) whether a cut is indeed an incorrect cut (i.e. after removing the proposed edges/vertices in the cut/separators, we should double check the connectivity); and (2) for minimal cuts, we should check whether they are indeed minimal.

In particular, the graphs listed in #2532 could be tested for cuts, while the graphs listed in #2521 could be used for separators.

One could use igraph_distances to check whether there is a path still between two specific nodes. So, the core of the test could be something like the following for cuts (and something similar for separators).

igraph_copy(&subgraph, &graph);
igraph_delete_edges(&subgraph, igraph_ess_vector(cut));
igraph_distances(&subgraph,
                &res,
                igraph_vss_1(source),
                igraph_vss_1(target),
                IGRAPH_OUT);
igraph_bool_t is_cut = !isinf(MATRIX(res, 0, 1));
@vtraag vtraag added the good first issue Candidates for first-time contributors who are already familiar with C label Mar 18, 2024
@ijbarnes
Copy link

Can I work on this? Im looking to contribute to an open source project for the first time.

@vtraag
Copy link
Member Author

vtraag commented Apr 1, 2024

Yes, you are also welcome to work on this!

Before getting started, make sure that you are able to compile a simple test program yourself, see https://igraph.org/c/doc/igraph-Tutorial.html to get started (see https://igraph.org/c/doc/igraph-Installation.html for how to install the development version of igraph).

One you've passed those first hurdles, try to see if you can create a small program according to the specifications above. Once you've got something running, it would be good to open a (draf) PR. Once it all works as expected we can integrate it properly into igraph as a test, I'll help you on your way there.

@szhorvat
Copy link
Member

szhorvat commented Apr 1, 2024

Just to be aware that @ijbarnes also asked about #2511. Be sure to work on one issue at a time, and let us know which one you chose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Candidates for first-time contributors who are already familiar with C
Projects
None yet
Development

No branches or pull requests

3 participants