-
Notifications
You must be signed in to change notification settings - Fork 0
Finding the matching(s) between two graphs
Inno Fang edited this page Jun 3, 2019
·
3 revisions
You can handle subgraph isomorphism result by implementing callback method, and determine whether only one result is needed by returning values from callback methods.
Matcher.match(state, new Matcher.Visitor() {
@Override
public boolean visit(HashMap<Integer, Integer> mapping) {
// mapping is the result of isomorphism
System.out.println(mapping);
return true;
}
})
Also, if you want to use lambda to refine above code
Matcher.match(state, mapping -> {
// mapping is the result of isomorphism
System.out.println(mapping);
return true;
})
Matcher.match(state, new Matcher.Visitor() {
@Override
public boolean visit(HashMap<Integer, Integer> mapping) {
// mapping is the result of isomorphism
System.out.println(mapping);
return false;
}
})
Also, if you want to use lambda to refine above code
Matcher.match(state, mapping -> {
// mapping is the result of isomorphism
System.out.println(mapping);
return true;
})