Commit 7f4fc289 authored by Ulmer Louis's avatar Ulmer Louis
Browse files

ajout du calcul d'augmentation de max en RO

parent ed4760c6
......@@ -213,7 +213,31 @@ public class GrapheMatrice extends Graphe {
return CA;
}
private static int maxValue(int[] ints) {
int max = ints[0];
for (int ktr = 0; ktr < ints.length; ktr++) {
if (ints[ktr] > max) {
max = ints[ktr];
}
}
return max;
}
public int calculAugmentationPossible(LinkedList<Sommet> CA){
Sommet s1,s2;
int longueur = CA.size()-1;
LinkedList<Integer> valeurs= new LinkedList();
Vector<Sommet> sommets= new Vector(this.sommets()); //conversion en Collection vecteur
for (int k=1; k<=longueur; k++) {
s1=sommets.get(k);
s2=sommets.get(k+1);
valeurs.add(this.valeurArc(s1,s2)-this.valeurFlux(s1,s2));
}
Integer valeurMin = Collections.min(valeurs);
return (valeurMin);
}
public String toString() {
StringBuilder retour = new StringBuilder();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment