File tree 1 file changed +1
-4
lines changed
1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ pub struct MinCostFlowEdge<T> {
11
11
pub struct MinCostFlowGraph < T > {
12
12
pos : Vec < ( usize , usize ) > ,
13
13
g : Vec < Vec < _Edge < T > > > ,
14
- cost_sum : T ,
15
14
}
16
15
17
16
impl < T > MinCostFlowGraph < T >
22
21
Self {
23
22
pos : vec ! [ ] ,
24
23
g : ( 0 ..n) . map ( |_| vec ! [ ] ) . collect ( ) ,
25
- cost_sum : T :: zero ( ) ,
26
24
}
27
25
}
28
26
56
54
assert ! ( cost >= T :: zero( ) ) ;
57
55
58
56
self . pos . push ( ( from, self . g [ from] . len ( ) ) ) ;
59
- self . cost_sum += cost;
60
57
61
58
let rev = self . g [ to] . len ( ) ;
62
59
self . g [ from] . push ( _Edge { to, rev, cap, cost } ) ;
@@ -131,7 +128,7 @@ where
131
128
pe : & mut [ usize ] ,
132
129
) -> bool {
133
130
let n = self . g . len ( ) ;
134
- let mut dist = vec ! [ self . cost_sum ; n] ;
131
+ let mut dist = vec ! [ T :: max_value ( ) ; n] ;
135
132
let mut vis = vec ! [ false ; n] ;
136
133
137
134
let mut que = std:: collections:: BinaryHeap :: new ( ) ;
You can’t perform that action at this time.
0 commit comments