Hello there. I am making a code for Travel Salesman Problem but i got this issue
function draw() {
background(0);
for (var i = 0; i < cities.length; i++) {
ellipse(cities[i].x , cities[i].y, 8, 8);
}
stroke(255)
strokeWeight(2)
noFill();
beginShape();
for (var i = 0; i < order.length; i++) {
var n = order [i];
vertex(cities [n].x, cities [n].y);
}
endShape();