-
Notifications
You must be signed in to change notification settings - Fork 92
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
Added strong_product, disjunctive_product, lexicographical_product, h… #154
base: master
Are you sure you want to change the base?
Conversation
…omomorphic_product
Co-authored-by: Aurora Rossi <65721467+aurorarossi@users.noreply.github.com>
Codecov Report
@@ Coverage Diff @@
## master #154 +/- ##
==========================================
+ Coverage 97.40% 97.43% +0.03%
==========================================
Files 109 109
Lines 6470 6560 +90
==========================================
+ Hits 6302 6392 +90
Misses 168 168 |
Hi! We recently added a JuliaFormatter and this pull request was made earlier, so it was not aligned. I fixed this problem and now the controls are fine except for one, since the homomorphic product is not tested. It would be great if you could provide one. |
src/operators.jl
Outdated
true | ||
``` | ||
""" | ||
function strong_product(g::G, h::G) where {G<:AbstractGraph} |
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.
Does this operator also work for directed graphs? And does it really make sense to define it for all graph types? Maybe we should restrict it to SimpleGraph
and maybe also SimpleDiGraph
.
Otherwise it might be a bit confusing if one has, for example, a graph with metadata on its vertices.
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.
Though I don't see mention in wikipedia of directed graphs in relation to any of these products, I think most of them would make sense. The only exception would be the homomorphic product which has (h_1 \nsim h_2) in its definition and there could be controversy over how that should be interpreted for directed graphs. Also this one is pretty obscure and I suspect nobody would ever want to use it on a directed graph.
Good point on not supporting graphs that have metadata. What would be the appropriate way to support both SimpleGraph and SimpleDiGraph? Should I use the common parent class AbstractSimpleGraph? (Note that the existing functions tensor_product and cartesian_product also have this issue.)
Making a round of unresolved PR conversations Metadata is not supported anywhere in Graphs.jl, that is why I don't think it's a requirement for graph products. The real issue is that these products require adding edges, and we can't guarantee this is supported beyond |
Is there anything needed from me? Should I make it take only SimpleGraph arguments rather than AbstractGraph? And if so, should I make the already existing graph product functions do the same? |
I think restricting these new functions to |
I changed SimpleGraph to AbstractSimpleGraph and fixed the doctests. The doctests had some trivial problems due to lines copied from tensor_product and somehow must not have been running before. |
Added most of the graph products from https://en.wikipedia.org/wiki/Graph_product