File tree Expand file tree Collapse file tree
edge-path-bundling/floyd-warshall
shortest-path/floyd-warshall Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,13 +85,10 @@ export type DrawGraphAndBundledEdgesParams = {
8585} ;
8686
8787export function drawBundledEdges ( { ctx, bundeledEdges } : DrawGraphAndBundledEdgesParams ) : void {
88- console . time ( 'Draw' ) ;
89-
9088 bundeledEdges . forEach ( ( { controlPoints } ) => {
9189 drawBezierCurve ( ctx , controlPoints , {
9290 width : 1 ,
9391 color : 'color(srgb 1 0 0 / 0.2)' ,
9492 } ) ;
9593 } ) ;
96- console . timeEnd ( 'Draw' ) ;
9794}
Original file line number Diff line number Diff line change 6767 const bundeledEdges = await epb .bundle ();
6868 console .timeEnd (' EPB' );
6969
70+ console .time (' Draw' );
7071 clearCanvas (context );
7172 drawBundledEdges ({ ctx: context , bundeledEdges });
73+ console .timeEnd (' Draw' );
7274 }
7375 </script >
7476
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ export class EdgePathBundlingGPUFloydWarshall implements EdgePathBundling {
4040 await this . #spanner. compute ( ) ;
4141 }
4242
43- if ( this . #edgeWeightFactor !== this . #spanner. maxDistortion ) {
43+ if ( this . #maxDistortion !== this . #spanner. maxDistortion ) {
4444 console . log ( 'Max distortion changed. Recomputing Spanner' ) ;
45- this . #spanner. maxDistortion = this . #edgeWeightFactor ;
45+ this . #spanner. maxDistortion = this . #maxDistortion ;
4646 await this . #spanner. compute ( ) ;
4747 }
4848
@@ -73,8 +73,6 @@ export class EdgePathBundlingGPUFloydWarshall implements EdgePathBundling {
7373 }
7474 } ) ;
7575
76- console . log ( 'difference' , difference . length ) ;
77-
7876 const shortestPaths = await this . #floydWarshall. shortestPaths ( difference ) ;
7977
8078 const bundeledEdges : {
Original file line number Diff line number Diff line change @@ -198,8 +198,6 @@ export class FloydWarshall {
198198 }
199199
200200 async shortestPaths ( paths : { start : number ; end : number } [ ] ) : Promise < ( Path | null ) [ ] > {
201- console . time ( 'Shortest Paths Buffer Data' ) ;
202-
203201 let pathsBuffer = this . #pathsBufferCache. get ( paths . length ) ;
204202
205203 const pathsBufferData = new BufferData (
@@ -232,10 +230,6 @@ export class FloydWarshall {
232230 } ) ;
233231 }
234232
235- console . timeEnd ( 'Shortest Paths Buffer Data' ) ;
236-
237- console . time ( 'Shortest Paths Buffer Compute' ) ;
238-
239233 const shortestPathsDistancesBuffer = this . #device. createBuffer ( {
240234 size : paths . length * 4 ,
241235 usage : GPUBufferUsage . STORAGE | GPUBufferUsage . COPY_DST | GPUBufferUsage . COPY_SRC ,
@@ -315,9 +309,7 @@ export class FloydWarshall {
315309 shortestPathsNodesReadBuffer ,
316310 Uint32Array
317311 ) ;
318- console . timeEnd ( 'Shortest Paths Buffer Compute' ) ;
319312
320- console . time ( 'Shortest Paths Buffer Map' ) ;
321313 const ret : ( Path | null ) [ ] = [ ] ;
322314
323315 for ( let i = 0 ; i < paths . length ; i ++ ) {
@@ -337,7 +329,6 @@ export class FloydWarshall {
337329 nodes,
338330 } ) ;
339331 }
340- console . timeEnd ( 'Shortest Paths Buffer Map' ) ;
341332
342333 return ret ;
343334 }
Original file line number Diff line number Diff line change @@ -41,8 +41,6 @@ export class ThetaSpanner extends Spanner {
4141 this . #k = this . #maxDistortion;
4242 // this.#k = this.#maxDistortion * 50;
4343
44- console . log ( { k : this . #k } ) ;
45-
4644 const positionsBufferData = new BufferData ( { x : 'float' , y : 'float' } , this . #graph. nodes . size ) ;
4745
4846 this . #graph. nodes . forEach ( ( { x, y } , index ) => {
You can’t perform that action at this time.
0 commit comments