File tree Expand file tree Collapse file tree 7 files changed +1052
-554
lines changed Expand file tree Collapse file tree 7 files changed +1052
-554
lines changed Original file line number Diff line number Diff line change 103103 "pinst" : " 3.0.0" ,
104104 "power-assert" : " 1.6.1" ,
105105 "regenerator-runtime" : " 0.14.1" ,
106- "xo" : " 0.53.1 "
106+ "xo" : " 0.57.0 "
107107 },
108108 "ava" : {
109109 "files" : [
219219 "unicorn/prefer-math-trunc" : " off" ,
220220 "unicorn/no-new-array" : " off" ,
221221 "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+ ]
223259 },
224260 "overrides" : [
225261 {
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ import {head} from '@iterable-iterator/slice';
99 * @returns {Map }
1010 */
1111export 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 ) ;
1414
1515 const H = new Map ( ) ;
1616
Original file line number Diff line number Diff line change 1+ import { PairingHeap as Heap } from '@heap-data-structure/pairing-heap' ;
12import { prop } from '@total-order/key' ;
23import { decreasing } from '@total-order/primitive' ;
3- import { PairingHeap as Heap } from '@heap-data-structure/pairing-heap' ;
44
55/**
66 * Lists the vertices of an undirected unweighted connected loopless multigraph
@@ -15,7 +15,6 @@ export default function* _order(G) {
1515
1616 for ( const v of G . keys ( ) ) refs . set ( v , heap . push ( { weight : 0 , vertex : v } ) ) ;
1717
18- // eslint-disable-next-line no-unused-vars
1918 for ( const _ of G ) {
2019 const max = heap . pop ( ) ;
2120 const u = max . vertex ;
Original file line number Diff line number Diff line change 11import { list } from '@iterable-iterator/list' ;
22import { map } from '@iterable-iterator/map' ;
33
4- import _order from './_order.js' ;
54import _contract from './_contract.js' ;
5+ import _order from './_order.js' ;
66
77/**
88 * Yields the small cuts of undirected unweighted connected loopless multigraph G.
@@ -18,8 +18,8 @@ export default function* _smallcuts(G) {
1818
1919 while ( H . size >= 2 ) {
2020 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 ) ;
2323
2424 yield [ new Set ( id . get ( y ) ) , cutsize ] ; // Yield a small cut with its size
2525
Original file line number Diff line number Diff line change 11import adj from '../adj.js' ;
22import outgoingedges from '../outgoingedges.js' ;
3+
34import mb from './mb.js' ;
45
56/**
Original file line number Diff line number Diff line change 11import test from 'ava' ;
2+
23import { map } from '@iterable-iterator/map' ;
34import { sorted } from '@iterable-iterator/sorted' ;
4- import { increasing } from '@total-order/primitive' ;
55import { fixedlexicographical } from '@total-order/lex' ;
6+ import { increasing } from '@total-order/primitive' ;
7+
68import { mincut } from '#module' ;
79
810function order ( edge ) {
You can’t perform that action at this time.
0 commit comments