File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Expand file tree Collapse file tree 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> {
1111pub struct MinCostFlowGraph < T > {
1212 pos : Vec < ( usize , usize ) > ,
1313 g : Vec < Vec < _Edge < T > > > ,
14- cost_sum : T ,
1514}
1615
1716impl < T > MinCostFlowGraph < T >
2221 Self {
2322 pos : vec ! [ ] ,
2423 g : ( 0 ..n) . map ( |_| vec ! [ ] ) . collect ( ) ,
25- cost_sum : T :: zero ( ) ,
2624 }
2725 }
2826
5654 assert ! ( cost >= T :: zero( ) ) ;
5755
5856 self . pos . push ( ( from, self . g [ from] . len ( ) ) ) ;
59- self . cost_sum += cost;
6057
6158 let rev = self . g [ to] . len ( ) ;
6259 self . g [ from] . push ( _Edge { to, rev, cap, cost } ) ;
@@ -131,7 +128,7 @@ where
131128 pe : & mut [ usize ] ,
132129 ) -> bool {
133130 let n = self . g . len ( ) ;
134- let mut dist = vec ! [ self . cost_sum ; n] ;
131+ let mut dist = vec ! [ T :: max_value ( ) ; n] ;
135132 let mut vis = vec ! [ false ; n] ;
136133
137134 let mut que = std:: collections:: BinaryHeap :: new ( ) ;
You can’t perform that action at this time.
0 commit comments