j'ai une classe pour décomposer un graph en rang :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
private int[] initialiseV()
    {
    int nbPred[] = new int[n] ;
 
    Noeud courant ;
 
    for (int i=0 ; i<n ; i++)
        {
        courant = liste[i].getPremier() ;
        while (courant != null)
            {
            ++nbPred[courant.getInfo().getNum()] ;
            courant = courant.getSuivant() ;
            }
        }
    return nbPred ;
    }
 
 
	private File initialiseF(int nbPred[])
    {
    File file = new File() ;
 
    for (int i=0 ; i<n ; i++)
        if (nbPred[i] == 0)
            file.enfile(new Noeud(new Info(i))) ;
 
    return file ;
    }
 
 
	public int[] calculeRangs()
    {
		int nbPred[] = initialiseV() ;
		File file = initialiseF(nbPred) ;
		int rang[] = new int[n] ;
 
		Noeud courant ;
 
		int i, sommet, rgCourant = 0 ;
 
		while (!file.estVide())
        {
			int s = file.getLongueur() ;
 
			for (int k=0 ; k<s ; k++)
            {
				sommet = file.defile().getInfo().getNum() ;
				rang[sommet] = rgCourant ;
 
				courant = liste[sommet].getPremier() ;
				while (courant != null)
                {
					i = courant.getInfo().getNum() ;
					--nbPred[i] ;
					if (nbPred[i] == 0)
						file.enfile(new Noeud(new Info(i))) ;
 
					courant = courant.getSuivant() ;
                }
            }
 
			++rgCourant ;
        }
 
    return rang ;
    }
mais je n'arrive à pas l'utiliser. Quoi dois-je écrire dans la classe main ?