Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ulmer Louis
ASI4_LouisULMER
Commits
7f4fc289
Commit
7f4fc289
authored
Dec 14, 2018
by
Ulmer Louis
Browse files
ajout du calcul d'augmentation de max en RO
parent
ed4760c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
RO/TP/classes/GrapheMatrice.class
View file @
7f4fc289
No preview for this file type
RO/TP/src/GrapheMatrice.java
View file @
7f4fc289
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment