-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (22 loc) · 929 Bytes
/
Main.java
File metadata and controls
30 lines (22 loc) · 929 Bytes
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
import java.util.ArrayList;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
ErdosProblem ep = new ErdosProblem();
Erdos erdos = new Erdos();
Author a1 = new Author("a1", new ArrayList<Paper>());
Author a2 = new Author("a2", new ArrayList<Paper>());
Author a3 = new Author("a3", new ArrayList<Paper>());
Paper p1 = new Paper("p1", Arrays.asList(a1, erdos));
Paper p2 = new Paper("p2", Arrays.asList(a1, a2));
Paper p3 = new Paper("p3", Arrays.asList(a2, a3));
Paper p4 = new Paper("p4", Arrays.asList(a3, erdos));
a1.papers.add(p1); // e = 0
a1.papers.add(p2); // e = 0
a2.papers.add(p2); // e = 1
a2.papers.add(p3); // e = 1
a3.papers.add(p3); // e = 2
a3.papers.add(p4); // e = 0
System.out.println("Erdos number: " + ep.getErdosNumber(a3));
}
}