-
Notifications
You must be signed in to change notification settings - Fork 3
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
Graph matching only handles node-induced sub-graph isomorphisms #400
Comments
You may want to check out |
@gabbard This appears to be a new feature in NetworkX 2.4. NetworkX's code for it is here. |
@spigo900 : Thanks. Updating the version of NetworkX we use should not be a problem. Can you briefly summarize the different between |
@gabbard It looks like the only important difference between their code and ours is that they set Looking into this more, it looks like the Comparing with the 2.4 code, I didn't see any important difference (other than names) in the syntactic feasibility check, in The only differences I noticed were the expected ones; as follows:
|
@spigo900 : Can you ensure that their definition of monomorphism matches our desired definition of edge-induced isomorphism (and summarize the two definitions for me)? I seem to recall looking at the monomorphism option when first implementing this and deciding it wasn't applicable to our use case for some reason. |
@gabbard Ah, I see. Sorry for the confusion. To be clear, what you're saying is that we want edge-induced isomorphism rather than non-induced subgraph isomorphism. In other words, we don't want to support patterns that have "orphan" nodes (ones with edges to no other vertices in the (sub)graph). That would make sense. In that case their definition does not match ours. As I understand it, "monomorphism" in their definition means looking for a non-induced subgraph, which includes edge-induced isomorphisms but also things which are not edge-induced (because they include orphan nodes). They claim that you can check for an edge-induced isomorphism using My understanding of the definitions:
|
@spigo900 : Can you clarify for me what I agree that the |
@spigo900 : If I am reading your definitions correctly, it looks like non-induced subgraph isomorphism under Ours and Theirs is the same? Can you give an example showing the distinction between an edge-induced isomorphism and a non-induced one? |
@gabbard If our pattern graph has a single connected component (and at least two vertices) then the two should be equivalent. Plausibly pattern intersection might cause problems there? I'm not sure. Yes, the "non-induced" definitions are the same, I think. Re: The distinction between edge-induced and non-induced, say you have a pair of graphs like this:
Then there's no edge-induced subgraph isomorphism between G1 and G2, because G2 has an orphan vertex (3), i.e. a vertex with no edges in or out. But when we take an edge-induced subgraph of G1, we include all and only the vertices that our chosen edges connect. (So in this case we could take any subset of the edges, but if we take say only the (1, 2) edge, then 3 won't appear in the edge-induced subgraph.) Since the subgraph of G1 has only the vertices incident to some subset of its edges, we can never end up with a vertex that has no edges, so we can't have an edge-induced subgraph of G1 that's isomorphic to G2. However, there is a non-induced subgraph isomorphism between G1 and G2. We can just match up the vertices with matching numbers. In this case (if I'm understand correctly) we have a monomorphism from G2 to G1. |
Got it. Since we expect both pattern and perception graphs to always have a single component, I think using monomorphisms will work. Can you: (a) confirm that re-enabling the constraint in #673 causes a failure |
|
@spigo900 : Thanks for the nice write-up.
|
re: #687 - I wonder if we need to push binding these back to situation generation? |
@gabbard That was the solution discussed at the time, especially if we want better control over the left/right hand when throwing a ball. |
@gabbard I tracked down the "transfer of posession" test problem. In the scene, Dad gives a baby a chair. The perception generator seems to have decided that dad's hand (hand_0) is also a part of the baby. (This causes the candidate baby subgraph to have too many nodes, so it gets rejected early as not matching the baby pattern, so we end up with not enough objects.) I'll continue looking into this. |
@gabbard Found it. The method for binding the action object variables doesn't actually get any description of the relational conditions, so it ignores them. Thus the baby is found to have four identical hands (two of them actually belonging to dad) and it arbitrarily chooses the first. (What distinguishes this from the throw crash situation, I think, is that in the other case the available manipulators are a dog head and two hands, and the two types of manipulators don't have identical features/properties.) |
@spigo900 : Thanks for tracking that down. Is it clear how to fix it or do you need guidance? |
@gabbard It's clear. From the discussion above, however, I was unsure though whether I should implement the direct solution for now if we might move variable binding earlier. (I think either should fix the test failures.) Should I go ahead and implement the direct solution? |
@spigo900 : If we can hack around our current problems, we probably won't implement early variable binding before our next milestone, so go ahead with the direct solution. |
We identify objects by matching "perceptual patterns" represented as graphs against a graph representation of the learner's perception using the VF2 sub-graph isomorphism algorithm. The implementation we borrowed from NetworkX and altered only handles node-induced isomorphism. In such isomorphisms, we align a set of nodes between the pattern and the target graph and require that all edges between the nodes in the pattern must have aligned edges in the target and vice-versa.
This can be a problem if additional edges are present in the target graph. For example, imagine that a concrete perception has more relationships between a target's axes than are specified in the pattern; we would still want this to match, but the extra edges would block a node-induced isomorphism.
We could switch to trying an edge-induced isomorphism algorithm, which aligns edges rather than nodes. Or we could make some sort of modification to our current algorithm to allow extra edges on the graph side.
I don't think this is an immediate problem, but it may become a problem as we enrich the perceptual representation with "noise" features.
The text was updated successfully, but these errors were encountered: