VF2 Isomorphism query, Python











up vote
-1
down vote

favorite












I am utilising the VF2 algorithm to map and compare 2 graphs with a differing structure but the same number of nodes and edges Because of this the algorithm won't compare my 2 graphs on the basis that some nodes don't have the exact same number of edges. Is there any way to change the source code of VF2 to allow it to ignore instances of nodes that have differing numbers of edges?



Example: I have two graphs in a noun:verb:noun format with nouns representing nodes and verbs representing edges between nodes. Both graphs have the same number of nodes and edges but with differing structure. I want to use VF2 to map these two graphs with differing graph structures but the same number of items. Right now VF2 terminates and doesn't print anything when it cannot extend the mapping of two nodes. I want it to print out the incomplete mapping of the two graphs at that stage.










share|improve this question
























  • What do you mean by "same structure" if the nodes don't have the same number of edges? For the algorithm you want to have, could you give an example of what a sample input would be and what you expect the output to be?
    – Joel
    Nov 21 at 21:42










  • Hi Joel. So the input is two graphs with the same number of nodes but a different number of edges connecting those nodes. What I want is an algorithm that doesn't terminate when when trying to map nodes with a different number of edges when comparing both graphs to each other and will instead ignore them and continue mapping the other nodes.
    – Lukas Clarke
    Nov 21 at 21:58










  • This is still unclear. Can you edit the question and give explicitly two input graphs and then state what the output should be? On the basis of what you've described, it sounds to me like you're trying to use an algorithm which is supposed to determine if two graphs are isomorphic. The graphs are not isomorphic, but you want it to do something different than just say that they aren't. I'm struggling to understand what your output should be.
    – Joel
    Nov 22 at 0:52












  • Updated the question
    – Lukas Clarke
    Nov 22 at 11:44










  • I'm still not sure what the output is you want. Can you give two small explicit graphs (as in tell us the nodes and their edges) and say exactly what the output should be? Since my understanding of VF2 is that it is supposed to find an isomorphism between two graphs, and from what you've described, your graphs are not isomorphic, it doesn't feel to me like it's what you want to be using.
    – Joel
    Nov 22 at 23:39















up vote
-1
down vote

favorite












I am utilising the VF2 algorithm to map and compare 2 graphs with a differing structure but the same number of nodes and edges Because of this the algorithm won't compare my 2 graphs on the basis that some nodes don't have the exact same number of edges. Is there any way to change the source code of VF2 to allow it to ignore instances of nodes that have differing numbers of edges?



Example: I have two graphs in a noun:verb:noun format with nouns representing nodes and verbs representing edges between nodes. Both graphs have the same number of nodes and edges but with differing structure. I want to use VF2 to map these two graphs with differing graph structures but the same number of items. Right now VF2 terminates and doesn't print anything when it cannot extend the mapping of two nodes. I want it to print out the incomplete mapping of the two graphs at that stage.










share|improve this question
























  • What do you mean by "same structure" if the nodes don't have the same number of edges? For the algorithm you want to have, could you give an example of what a sample input would be and what you expect the output to be?
    – Joel
    Nov 21 at 21:42










  • Hi Joel. So the input is two graphs with the same number of nodes but a different number of edges connecting those nodes. What I want is an algorithm that doesn't terminate when when trying to map nodes with a different number of edges when comparing both graphs to each other and will instead ignore them and continue mapping the other nodes.
    – Lukas Clarke
    Nov 21 at 21:58










  • This is still unclear. Can you edit the question and give explicitly two input graphs and then state what the output should be? On the basis of what you've described, it sounds to me like you're trying to use an algorithm which is supposed to determine if two graphs are isomorphic. The graphs are not isomorphic, but you want it to do something different than just say that they aren't. I'm struggling to understand what your output should be.
    – Joel
    Nov 22 at 0:52












  • Updated the question
    – Lukas Clarke
    Nov 22 at 11:44










  • I'm still not sure what the output is you want. Can you give two small explicit graphs (as in tell us the nodes and their edges) and say exactly what the output should be? Since my understanding of VF2 is that it is supposed to find an isomorphism between two graphs, and from what you've described, your graphs are not isomorphic, it doesn't feel to me like it's what you want to be using.
    – Joel
    Nov 22 at 23:39













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I am utilising the VF2 algorithm to map and compare 2 graphs with a differing structure but the same number of nodes and edges Because of this the algorithm won't compare my 2 graphs on the basis that some nodes don't have the exact same number of edges. Is there any way to change the source code of VF2 to allow it to ignore instances of nodes that have differing numbers of edges?



Example: I have two graphs in a noun:verb:noun format with nouns representing nodes and verbs representing edges between nodes. Both graphs have the same number of nodes and edges but with differing structure. I want to use VF2 to map these two graphs with differing graph structures but the same number of items. Right now VF2 terminates and doesn't print anything when it cannot extend the mapping of two nodes. I want it to print out the incomplete mapping of the two graphs at that stage.










share|improve this question















I am utilising the VF2 algorithm to map and compare 2 graphs with a differing structure but the same number of nodes and edges Because of this the algorithm won't compare my 2 graphs on the basis that some nodes don't have the exact same number of edges. Is there any way to change the source code of VF2 to allow it to ignore instances of nodes that have differing numbers of edges?



Example: I have two graphs in a noun:verb:noun format with nouns representing nodes and verbs representing edges between nodes. Both graphs have the same number of nodes and edges but with differing structure. I want to use VF2 to map these two graphs with differing graph structures but the same number of items. Right now VF2 terminates and doesn't print anything when it cannot extend the mapping of two nodes. I want it to print out the incomplete mapping of the two graphs at that stage.







python graph networkx isomorphism






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 at 11:44

























asked Nov 21 at 20:52









Lukas Clarke

112




112












  • What do you mean by "same structure" if the nodes don't have the same number of edges? For the algorithm you want to have, could you give an example of what a sample input would be and what you expect the output to be?
    – Joel
    Nov 21 at 21:42










  • Hi Joel. So the input is two graphs with the same number of nodes but a different number of edges connecting those nodes. What I want is an algorithm that doesn't terminate when when trying to map nodes with a different number of edges when comparing both graphs to each other and will instead ignore them and continue mapping the other nodes.
    – Lukas Clarke
    Nov 21 at 21:58










  • This is still unclear. Can you edit the question and give explicitly two input graphs and then state what the output should be? On the basis of what you've described, it sounds to me like you're trying to use an algorithm which is supposed to determine if two graphs are isomorphic. The graphs are not isomorphic, but you want it to do something different than just say that they aren't. I'm struggling to understand what your output should be.
    – Joel
    Nov 22 at 0:52












  • Updated the question
    – Lukas Clarke
    Nov 22 at 11:44










  • I'm still not sure what the output is you want. Can you give two small explicit graphs (as in tell us the nodes and their edges) and say exactly what the output should be? Since my understanding of VF2 is that it is supposed to find an isomorphism between two graphs, and from what you've described, your graphs are not isomorphic, it doesn't feel to me like it's what you want to be using.
    – Joel
    Nov 22 at 23:39


















  • What do you mean by "same structure" if the nodes don't have the same number of edges? For the algorithm you want to have, could you give an example of what a sample input would be and what you expect the output to be?
    – Joel
    Nov 21 at 21:42










  • Hi Joel. So the input is two graphs with the same number of nodes but a different number of edges connecting those nodes. What I want is an algorithm that doesn't terminate when when trying to map nodes with a different number of edges when comparing both graphs to each other and will instead ignore them and continue mapping the other nodes.
    – Lukas Clarke
    Nov 21 at 21:58










  • This is still unclear. Can you edit the question and give explicitly two input graphs and then state what the output should be? On the basis of what you've described, it sounds to me like you're trying to use an algorithm which is supposed to determine if two graphs are isomorphic. The graphs are not isomorphic, but you want it to do something different than just say that they aren't. I'm struggling to understand what your output should be.
    – Joel
    Nov 22 at 0:52












  • Updated the question
    – Lukas Clarke
    Nov 22 at 11:44










  • I'm still not sure what the output is you want. Can you give two small explicit graphs (as in tell us the nodes and their edges) and say exactly what the output should be? Since my understanding of VF2 is that it is supposed to find an isomorphism between two graphs, and from what you've described, your graphs are not isomorphic, it doesn't feel to me like it's what you want to be using.
    – Joel
    Nov 22 at 23:39
















What do you mean by "same structure" if the nodes don't have the same number of edges? For the algorithm you want to have, could you give an example of what a sample input would be and what you expect the output to be?
– Joel
Nov 21 at 21:42




What do you mean by "same structure" if the nodes don't have the same number of edges? For the algorithm you want to have, could you give an example of what a sample input would be and what you expect the output to be?
– Joel
Nov 21 at 21:42












Hi Joel. So the input is two graphs with the same number of nodes but a different number of edges connecting those nodes. What I want is an algorithm that doesn't terminate when when trying to map nodes with a different number of edges when comparing both graphs to each other and will instead ignore them and continue mapping the other nodes.
– Lukas Clarke
Nov 21 at 21:58




Hi Joel. So the input is two graphs with the same number of nodes but a different number of edges connecting those nodes. What I want is an algorithm that doesn't terminate when when trying to map nodes with a different number of edges when comparing both graphs to each other and will instead ignore them and continue mapping the other nodes.
– Lukas Clarke
Nov 21 at 21:58












This is still unclear. Can you edit the question and give explicitly two input graphs and then state what the output should be? On the basis of what you've described, it sounds to me like you're trying to use an algorithm which is supposed to determine if two graphs are isomorphic. The graphs are not isomorphic, but you want it to do something different than just say that they aren't. I'm struggling to understand what your output should be.
– Joel
Nov 22 at 0:52






This is still unclear. Can you edit the question and give explicitly two input graphs and then state what the output should be? On the basis of what you've described, it sounds to me like you're trying to use an algorithm which is supposed to determine if two graphs are isomorphic. The graphs are not isomorphic, but you want it to do something different than just say that they aren't. I'm struggling to understand what your output should be.
– Joel
Nov 22 at 0:52














Updated the question
– Lukas Clarke
Nov 22 at 11:44




Updated the question
– Lukas Clarke
Nov 22 at 11:44












I'm still not sure what the output is you want. Can you give two small explicit graphs (as in tell us the nodes and their edges) and say exactly what the output should be? Since my understanding of VF2 is that it is supposed to find an isomorphism between two graphs, and from what you've described, your graphs are not isomorphic, it doesn't feel to me like it's what you want to be using.
– Joel
Nov 22 at 23:39




I'm still not sure what the output is you want. Can you give two small explicit graphs (as in tell us the nodes and their edges) and say exactly what the output should be? Since my understanding of VF2 is that it is supposed to find an isomorphism between two graphs, and from what you've described, your graphs are not isomorphic, it doesn't feel to me like it's what you want to be using.
– Joel
Nov 22 at 23:39

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420304%2fvf2-isomorphism-query-python%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420304%2fvf2-isomorphism-query-python%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Berounka

Fiat S.p.A.

Type 'String' is not a subtype of type 'int' of 'index'