-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolveClique.java
More file actions
26 lines (23 loc) · 813 Bytes
/
solveClique.java
File metadata and controls
26 lines (23 loc) · 813 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
package npc;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
class solveClique {
public static void main (String[] args) {
String filename = args[0];
List<Graph> graphs = Graph.makeAllGraphsFromFile(filename);
System.out.println("* Max Cliques in graphs in " + filename);
System.out.println("\t(|V|,|E|) Cliques (size, ms used)");
//for (Graph graph: graphs) {
Graph graph = graphs.get(3);
long start = System.currentTimeMillis();
Set<Integer> maxClique = graph.findLargestClique();
System.out.println(
graph + " {" + maxClique.stream().map(v -> v.toString()).collect(Collectors.joining(", ")) +
"} (size=" + maxClique.size() + ", " + (System.currentTimeMillis() - start) + " ms)"
);
graph.debug();
//}
System.out.println("***");
}
}