File tree 7 files changed +1052
-554
lines changed
7 files changed +1052
-554
lines changed Original file line number Diff line number Diff line change 103
103
"pinst" : " 3.0.0" ,
104
104
"power-assert" : " 1.6.1" ,
105
105
"regenerator-runtime" : " 0.14.1" ,
106
- "xo" : " 0.53.1 "
106
+ "xo" : " 0.57.0 "
107
107
},
108
108
"ava" : {
109
109
"files" : [
219
219
"unicorn/prefer-math-trunc" : " off" ,
220
220
"unicorn/no-new-array" : " off" ,
221
221
"no-negated-condition" : " off" ,
222
- "unicorn/prefer-node-protocol" : " off"
222
+ "unicorn/prefer-node-protocol" : " off" ,
223
+ "import/order" : [
224
+ " error" ,
225
+ {
226
+ "groups" : [
227
+ " builtin" ,
228
+ " external" ,
229
+ " internal" ,
230
+ " parent" ,
231
+ " sibling" ,
232
+ " index" ,
233
+ " object" ,
234
+ " type"
235
+ ],
236
+ "pathGroups" : [
237
+ {
238
+ "pattern" : " ava" ,
239
+ "group" : " external" ,
240
+ "position" : " before"
241
+ },
242
+ {
243
+ "pattern" : " #module" ,
244
+ "group" : " index" ,
245
+ "position" : " after"
246
+ }
247
+ ],
248
+ "pathGroupsExcludedImportTypes" : [],
249
+ "distinctGroup" : true ,
250
+ "newlines-between" : " always" ,
251
+ "alphabetize" : {
252
+ "order" : " asc" ,
253
+ "orderImportKind" : " asc" ,
254
+ "caseInsensitive" : false
255
+ },
256
+ "warnOnUnassignedImports" : true
257
+ }
258
+ ]
223
259
},
224
260
"overrides" : [
225
261
{
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ import {head} from '@iterable-iterator/slice';
9
9
* @returns {Map }
10
10
*/
11
11
export default function _contract ( G , ordering ) {
12
- const u = ordering [ ordering . length - 2 ] ;
13
- const v = ordering [ ordering . length - 1 ] ;
12
+ const u = ordering . at ( - 2 ) ;
13
+ const v = ordering . at ( - 1 ) ;
14
14
15
15
const H = new Map ( ) ;
16
16
Original file line number Diff line number Diff line change
1
+ import { PairingHeap as Heap } from '@heap-data-structure/pairing-heap' ;
1
2
import { prop } from '@total-order/key' ;
2
3
import { decreasing } from '@total-order/primitive' ;
3
- import { PairingHeap as Heap } from '@heap-data-structure/pairing-heap' ;
4
4
5
5
/**
6
6
* Lists the vertices of an undirected unweighted connected loopless multigraph
@@ -15,7 +15,6 @@ export default function* _order(G) {
15
15
16
16
for ( const v of G . keys ( ) ) refs . set ( v , heap . push ( { weight : 0 , vertex : v } ) ) ;
17
17
18
- // eslint-disable-next-line no-unused-vars
19
18
for ( const _ of G ) {
20
19
const max = heap . pop ( ) ;
21
20
const u = max . vertex ;
Original file line number Diff line number Diff line change 1
1
import { list } from '@iterable-iterator/list' ;
2
2
import { map } from '@iterable-iterator/map' ;
3
3
4
- import _order from './_order.js' ;
5
4
import _contract from './_contract.js' ;
5
+ import _order from './_order.js' ;
6
6
7
7
/**
8
8
* Yields the small cuts of undirected unweighted connected loopless multigraph G.
@@ -18,8 +18,8 @@ export default function* _smallcuts(G) {
18
18
19
19
while ( H . size >= 2 ) {
20
20
const ordering = list ( _order ( H ) ) ; // Compute the max-back order
21
- const [ x ] = ordering [ ordering . length - 2 ] ;
22
- const [ y , cutsize ] = ordering [ ordering . length - 1 ] ;
21
+ const [ x ] = ordering . at ( - 2 ) ;
22
+ const [ y , cutsize ] = ordering . at ( - 1 ) ;
23
23
24
24
yield [ new Set ( id . get ( y ) ) , cutsize ] ; // Yield a small cut with its size
25
25
Original file line number Diff line number Diff line change 1
1
import adj from '../adj.js' ;
2
2
import outgoingedges from '../outgoingedges.js' ;
3
+
3
4
import mb from './mb.js' ;
4
5
5
6
/**
Original file line number Diff line number Diff line change 1
1
import test from 'ava' ;
2
+
2
3
import { map } from '@iterable-iterator/map' ;
3
4
import { sorted } from '@iterable-iterator/sorted' ;
4
- import { increasing } from '@total-order/primitive' ;
5
5
import { fixedlexicographical } from '@total-order/lex' ;
6
+ import { increasing } from '@total-order/primitive' ;
7
+
6
8
import { mincut } from '#module' ;
7
9
8
10
function order ( edge ) {
You can’t perform that action at this time.
0 commit comments