-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
34 lines (21 loc) · 869 Bytes
/
Main.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
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
File file = new File("/amuhome/p16031405/Documents/L3/Algo/TP1/src/formula.txt");
Scanner scan = new Scanner(file);
int size = Integer.valueOf(scan.nextLine());
Graph<Integer> graph = new Graph<Integer>(size*2);
graph.buildImplicationGraph(0, scan);
System.out.println(graph);
//System.out.println("Le graphe transpose : \n" + graph.buildTranspose());
ArrayList<Integer> endDates = graph.fullDfs();
Graph<Integer> transpose = graph.buildTranspose();
ArrayList<LinkedList<Integer>> scc = transpose.dfsOnTranspose(endDates);
graph.printResult(scc);
scan.close();
}
}