-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVF2Test.java
160 lines (139 loc) · 6.91 KB
/
VF2Test.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
package io.github.innofang.lib;
import io.github.innofang.graph.datasets.EmailEuCoreDataSet;
import io.github.innofang.graph.datasets.GraphDBDataSet;
import io.github.innofang.graph.datasets.UnweightedDiGraphDataSet;
import io.github.innofang.graph.datasets.UnweightedGraphDBDataSet;
import io.github.innofang.util.MatchHelper;
import org.junit.Test;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
public class VF2Test {
@Test
public void testVF2WithBigData() throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
String queryGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\graphDB\\Q4.txt";
String targetGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\graphDB\\dataset.txt";
MatchHelper.testIsomorphismAlgorithm(
targetGraphPath,
queryGraphPath,
VF2State.class,
new GraphDBDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testVF2WithGraphDB100() throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
String queryGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\graphDB-100\\Q24.txt";
String targetGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\graphDB-100\\dataset.txt";
MatchHelper.testIsomorphismAlgorithm(
targetGraphPath,
queryGraphPath,
VF2State.class,
new GraphDBDataSet(),
mapping -> false
);
}
@Test
public void testVF2() throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
String sourceGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\test\\isomorphism\\source_graph.txt";
String targetGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\test\\isomorphism\\target_graph.txt";
MatchHelper.testIsomorphismAlgorithm(
targetGraphPath,
sourceGraphPath,
VF2State.class,
new GraphDBDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testVF2WithEmailEuCore() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, IOException {
String sourceGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\email-Eu-core\\Q4.txt-10-unweighted.my";
String targetGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\email-Eu-core\\email-Eu-core.txt";
MatchHelper.testIsomorphismAlgorithm(
targetGraphPath,
sourceGraphPath,
VF2State.class,
new EmailEuCoreDataSet(),
new UnweightedGraphDBDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testVF2WithEmailEuCoreAndQueryGraph() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, IOException {
// String sourceGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\unweighted-digraph\\V3E3.txt";
// String sourceGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\unweighted-digraph\\V4E5.txt";
// String sourceGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\unweighted-digraph\\V5E6.txt";
String sourceGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\unweighted-digraph\\V6E7.txt";
String targetGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\email-Eu-core\\email-Eu-core.txt";
MatchHelper.testIsomorphismAlgorithm(
targetGraphPath,
sourceGraphPath,
VF2State.class,
new EmailEuCoreDataSet(),
new UnweightedDiGraphDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testVF2WithEmailEuCoreAndQueryGraph2() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, IOException {
String sourceGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\unweighted-digraph\\V7E7.txt";
String targetGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\email-Eu-core\\email-Eu-core.txt";
MatchHelper.testIsomorphismAlgorithm(
targetGraphPath,
sourceGraphPath,
VF2State.class,
new EmailEuCoreDataSet(),
new UnweightedDiGraphDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testVF2WithEmailEuCoreDepartmentLabel() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, IOException {
String sourceGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\email-Eu-core\\Q4.txt-10-unweighted.my";
String targetGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\email-Eu-core\\email-Eu-core-department-labels.txt";
MatchHelper.testIsomorphismAlgorithm(
targetGraphPath,
sourceGraphPath,
VF2State.class,
new EmailEuCoreDataSet(),
new UnweightedGraphDBDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testVF2WithUnweightedDiGraph() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, IOException {
// If you want to use the following data sets, you should run the unweighted-digraph-generator.py first.
// python unweighted-digraph-generator.py multiple -v 5 -e 7 -n 5
String sourceGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\unweighted-digraph\\Q5-5.txt";
// python unweighted-digraph-generator.py single -v 100 -e 1560
String targetGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\unweighted-digraph\\V100E1560.txt";
MatchHelper.testIsomorphismAlgorithm(
targetGraphPath,
sourceGraphPath,
VF2State.class,
new UnweightedDiGraphDataSet(),
new UnweightedGraphDBDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
}