-
Notifications
You must be signed in to change notification settings - Fork 58
Add AmalgamDigraphs
#532
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
base: main
Are you sure you want to change the base?
Add AmalgamDigraphs
#532
Conversation
dfb2612
to
1f46844
Compare
3110b0c
to
5fae321
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@finnbuck looks great! Lots of small things to fix, but generally this is good! Some additional things:
- please also add some tests when the arguments are mutable digraphs, I don't think this'll work quite like you expect (see comments in the PR)
- Add a version that takes 4 digraphs,
D1
,D2
, andS
and a transformationmap1
(embeddingS
inD1
), then computesmap2
(an embedding ofS
inD2
) and callsDigraphAmalgam(D1, D2, S, map1, map2);
- Add a version that takes 3 digraphs:
D1
,D2
andS
and computesmap1
andmap2
(embeddings intoD1
andD2
resp), and callsDigraphAmalgam(D1, D2, S, map1, map2);
- Add a version that takes 2 digraphs
D1
andD2
, and callsx := MaximumCommonSubdigraph(D1, D2);
and then returnsDigraphAmalgam(D1, D2, x[1], x[2], x[3]);
@james-d-mitchell thanks for the review, I'll get to work on that! |
a604293
to
49e5ef5
Compare
f10e594
to
2528c7b
Compare
3f5ce71
to
5e70d76
Compare
74b3afd
to
0551db9
Compare
I've squashed and rebased this on the latest |
24760a9
to
f5e6563
Compare
f5e6563
to
155fd3e
Compare
Based on Issue #428. This pull request adds two functions: AmalgamDigraphs and AmalgamDigraphsIsomorphic.
Description:
The AmalgamDigraphs function takes as input two digraphs and two lists of vertices corresponding to two identical subdigraphs of the two input digraphs. It returns a new digraph which consists of the two input digraphs joined together by their common subdigraph in such a way that the edge connectivity between the vertices in the new digraph matches the edge connectivity of the two input digraphs.
AmalgamDigraphsIsomorphic functions similarly, but the two lists of vertices given as inputs need only describe subdigraphs that are isomorphic to one another rather than have them be precisely equal. AmalgamDigraphsIsomorphic then rearranges the second list of subdigraph vertices so that the induced subdigraphs become equal and then calls AmalgamDigraphs.
Both functions return a tuple of size two, with the first element being the output digraph and the second being a record which maps each vertex number in the second input digraph to its new vertex number in the output digraph. The mapping of the vertices of the first input digraph can be seen as the identity mapping.