Solve, time, and profile programs solving the traveling salesperson problem in various languages. Solution relies on use of graph object.

Makefile 695B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Set path to guava
  2. MAYA_HOME=/Users/charles
  3. CRONUS_HOME=/Volumes/noospace/Users/charles
  4. GUAVA=$(MAYA_HOME)/codes/guava/jars/guava-21.0.jar
  5. # Set compile target
  6. TARGET=TSP.java
  7. BIN=TSP
  8. ## Time first,
  9. ## profile l8r.
  10. #PATH2JIPJAR=/Users/charles/Downloads/jip-src-1.2/profile/profile.jar
  11. #AGENT=-javaagent:$(PATH2JIPJAR)
  12. # Set java class path
  13. # Hard to believe this actually works, but ok:
  14. CP=-cp '.:$(GUAVA)'
  15. build:
  16. javac $(CP) $(TARGET)
  17. run:
  18. # If no size, use default
  19. java $(CP) $(BIN)
  20. dot:
  21. dot graphviz.dot -Tpng -o graphviz.png
  22. time:
  23. # Java times itself, we just have to pass it the size
  24. java $(CP) $(BIN) $(SIZE)
  25. clean:
  26. rm -rf *.class
  27. .PHONY: clean
  28. tsp: clean build run