Added tests, renamed cost function to match specification,
moved edmonton graph building outside of if: __main to match
specifications.