@@ -209,9 +209,10 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
209
209
bestedge [ b ] = - 1 ;
210
210
if ( t === 1 ) {
211
211
// B became an S-vertex/blossom; add it(s vertices) to the queue.
212
- blossomLeaves ( nvertex , blossomchilds , b , function ( v ) {
212
+ for ( const v of blossomLeaves ( nvertex , blossomchilds , b ) ) {
213
213
queue . push ( v ) ;
214
- } ) ;
214
+ }
215
+
215
216
console . debug ( 'DEBUG: PUSH ' + queue ) ;
216
217
} else if ( t === 2 ) {
217
218
// B became a T-vertex/blossom; assign label S to its mate.
@@ -363,15 +364,15 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
363
364
// Set dual variable to zero.
364
365
dualvar [ b ] = 0 ;
365
366
// Relabel vertices.
366
- blossomLeaves ( nvertex , blossomchilds , b , function ( v ) {
367
+ for ( const v of blossomLeaves ( nvertex , blossomchilds , b ) ) {
367
368
if ( label [ inblossom [ v ] ] === 2 ) {
368
369
// This T-vertex now turns into an S-vertex because it becomes
369
370
// part of an S-blossom; add it to the queue.
370
371
queue . push ( v ) ;
371
372
}
372
373
373
374
inblossom [ v ] = b ;
374
- } ) ;
375
+ }
375
376
376
377
// Compute blossombestedges[b].
377
378
@@ -387,7 +388,7 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
387
388
// This subblossom does not have a list of least-slack edges;
388
389
// get the information from the vertices.
389
390
nblists = [ ] ;
390
- blossomLeaves ( nvertex , blossomchilds , bv , function ( v ) {
391
+ for ( const v of blossomLeaves ( nvertex , blossomchilds , bv ) ) {
391
392
j = neighbend [ v ] . length ;
392
393
temporary_ = new Array ( j ) ;
393
394
while ( j -- ) {
@@ -396,7 +397,7 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
396
397
}
397
398
398
399
nblists . push ( temporary_ ) ;
399
- } ) ;
400
+ }
400
401
} else {
401
402
// Walk this subblossom's least-slack edges.
402
403
nblists = [ blossombestedges [ bv ] ] ;
@@ -483,9 +484,9 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
483
484
// Recursively expand this sub-blossom.
484
485
expandBlossom ( s , endstage ) ;
485
486
} else {
486
- blossomLeaves ( nvertex , blossomchilds , s , function ( v ) {
487
+ for ( const v of blossomLeaves ( nvertex , blossomchilds , s ) ) {
487
488
inblossom [ v ] = s ;
488
- } ) ;
489
+ }
489
490
}
490
491
}
491
492
@@ -553,7 +554,7 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
553
554
continue ;
554
555
}
555
556
556
- blossomLeaves ( nvertex , blossomchilds , bv , function ( v ) {
557
+ for ( const v of blossomLeaves ( nvertex , blossomchilds , bv ) ) {
557
558
if ( label [ v ] !== 0 ) {
558
559
// If the sub-blossom contains a reachable vertex, assign
559
560
// label T to the sub-blossom.
@@ -562,9 +563,9 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
562
563
label [ v ] = 0 ;
563
564
label [ endpoint [ mate [ blossombase [ bv ] ] ] ] = 0 ;
564
565
assignLabel ( v , 2 , labelend [ v ] ) ;
565
- return true ;
566
+ break ;
566
567
}
567
- } ) ;
568
+ }
568
569
569
570
j += jstep ;
570
571
}
0 commit comments