Skip to content

Commit

Permalink
some documentation for TSP
Browse files Browse the repository at this point in the history
  • Loading branch information
aewallin committed Aug 2, 2018
1 parent 8dcaaa5 commit aa533a2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/pathdropcutter_test_2.py
Expand Up @@ -95,8 +95,9 @@
t_after = time.time()
calctime = t_after-t_before
print " done in ", calctime," s"

cl_filtered = f.getCLPoints()
print " after filter we have", len(cl_filtered),"cl-points"

aclp_lifted2=[]
for p in cl_filtered:
p2 = ocl.Point(p.x,p.y,p.z) + ocl.Point(0,0,1)
Expand Down
13 changes: 13 additions & 0 deletions scripts/tsp/tsp_01.py
Expand Up @@ -6,6 +6,19 @@
import math
import gzip

# Travelling Salesman Problem
# a.k.a. drill-path optimization
#
# we have multiple points in the 2D plane to visit.
# the task is to optimize the distance travelled by the tool while
# visiting all points
#
# uses data from TSPLIB (not included in opencamlib)
#
# ocl.TSPSolver() is a wrapper for boost::metric_tsp_approx()
# https://www.boost.org/doc/libs/1_67_0/libs/graph/doc/metric_tsp_approx.html


def drawPoints(myscreen, pts):
c=camvtk.PointCloud( pts )
c.SetPoints()
Expand Down

0 comments on commit aa533a2

Please sign in to comment.