@@ -7,7 +7,7 @@ import BHNode from "../heaps/bHNode";
77// import FHNode from "./heaps/fHNode";
88import ListSet from "../disjoint-sets/listSet" ;
99import ForestSet from "../disjoint-sets/forestSet" ;
10- import fs from "fs" ;
10+ import * as fs from "fs" ;
1111import Vertex from "./vertex" ;
1212
1313// Returns a random number between [min,max)
@@ -65,6 +65,7 @@ class Graph<T> {
6565 return false ;
6666 } ;
6767
68+ // FOR karge min cut
6869 // Returns how many edges are between verteces u and v
6970 hme = ( u : T , v : T ) => {
7071 if ( ! this . contains ( u ) ) return false ;
@@ -76,6 +77,7 @@ class Graph<T> {
7677 return c ;
7778 } ;
7879
80+ // FOR karge min cut
7981 // Returns the number of edges of this graph
8082 countEdges = ( ) => {
8183 let c = 0 ;
@@ -87,6 +89,7 @@ class Graph<T> {
8789 return c / 2 ;
8890 } ;
8991
92+ // FOR karge min cut
9093 // Returns the key of two neighbours [u,v]
9194 pickRandomEdge = ( ) => {
9295 const keys = [ ...this . list . keys ( ) ] ;
@@ -98,6 +101,7 @@ class Graph<T> {
98101 return [ u , v ] ;
99102 } ;
100103
104+ // FOR karge min cut
101105 // Merge two verteces into a single one
102106 mergeVerteces = ( u : T , v : T ) => {
103107 // adds all neighbours of v to u
@@ -1099,4 +1103,4 @@ class Graph<T> {
10991103 } ;
11001104}
11011105
1102- export = Graph ;
1106+ export default Graph ;
0 commit comments