-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestGraph.java
More file actions
24 lines (20 loc) · 1022 Bytes
/
Copy pathtestGraph.java
File metadata and controls
24 lines (20 loc) · 1022 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
package Graphes;
import java.util.ArrayList;
import java.util.List;
public class testGraph {
public static void main(String[] args) {
// Test du graphe du dernier CC
Graph graphe = new Graph();
graphe.setDebug(true);
graphe.addNode(new Node("1",new ArrayList<>(List.of("1","2","3")),new ArrayList<>(List.of("1"))));
graphe.addNode(new Node("2",new ArrayList<>(List.of("3","4","5")),new ArrayList<>(List.of("1"))));
graphe.addNode(new Node("3",new ArrayList<>(List.of("3","4")),new ArrayList<>(List.of("1","2","3"))));
graphe.addNode(new Node("4",new ArrayList<>(List.of("5")),new ArrayList<>(List.of("2","3"))));
graphe.addNode(new Node("5",new ArrayList<>(List.of("5")),new ArrayList<>(List.of("2","4","5"))));
graphe.buildArcs();
System.out.println(graphe);
System.out.println();
// System.out.println(graphe.listSuccessors(graphe.getNode("1")));
Algos.parcoursProfondeur(graphe,graphe.getNode("1"));
}
}