Skip to content

wires/tsplib.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tsplib.js

(partially) parse TSPLIB files

http://www.iwr.uni-heidelberg.de/groups/comopt/software/TSPLIB95/

File format infomation here.

var fs = require('fs')
var TSPLIB = require('./tsplib');
var s = fs.readFileSync('../TSPLIB95/kroA100.tsp').toString();
var p = TSPLIB.parse(s);

Now p looks like

	{ name: 'kroA100',
	  type: 'TSP',
	  dimension: 100,
	  edgeWeightType: 'EUC_2D',
	  nodes:
	   [ [ 1, 1380, 939 ],
	     [ 2, 2848, 96 ],
	     [ 3, 3510, 1671 ],
	     [ 4, 457, 334 ],
	     /* .... */
	   ]
	}

About

(partially) parse TSPLIB files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published