-
Notifications
You must be signed in to change notification settings - Fork 0
/
UllmannTest.java
142 lines (123 loc) · 6.34 KB
/
UllmannTest.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
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 UllmannTest {
@Test
public void testUllmannWithBigData() 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,
UllmannState.class,
new GraphDBDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testUllmannWithGraphDB100() throws IOException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
String queryGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\graphDB-100\\Q16.txt";
String targetGraphPath = "F:\\IDEA\\subgraph-isomorphism\\datasets\\graphDB-100\\dataset.txt";
MatchHelper.testIsomorphismAlgorithm(
targetGraphPath,
queryGraphPath,
UllmannState.class,
new GraphDBDataSet(),
mapping -> false
);
}
@Test
public void testUllmann() 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, // 查询图路径
UllmannState.class, // 选取Ullmann算法
new GraphDBDataSet(), // 图数据读取策略
mapping -> { // 对子图同构结果进行处理
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testUllmannWithEmailEuCore() 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,
UllmannState.class,
new EmailEuCoreDataSet(),
new UnweightedGraphDBDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testUllmannWithEmailEuCoreAndQueryGraph() 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 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,
UllmannState.class,
new EmailEuCoreDataSet(),
new UnweightedDiGraphDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testUllmannWithEmailEuCoreDepartmentLabel() 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,
UllmannState.class,
new EmailEuCoreDataSet(),
new UnweightedGraphDBDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
@Test
public void testUllmannWithUnweightedDiGraph() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, IOException {
// 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,
UllmannState.class,
new UnweightedDiGraphDataSet(),
new UnweightedGraphDBDataSet(),
mapping -> {
System.out.println(mapping.toString());
return false;
}
);
}
}