diff --git a/project5 b/project5 index e061e86..e643f06 100755 Binary files a/project5 and b/project5 differ diff --git a/project5.cc b/project5.cc index f7eaba3..39f14f3 100644 --- a/project5.cc +++ b/project5.cc @@ -54,6 +54,7 @@ int main(int argc, char *argv[]) { std::cout << "------------------------------------------------" << std::endl; std::cout << std::endl; + } diff --git a/province.cc b/province.cc index 9ac9323..ece8147 100644 --- a/province.cc +++ b/province.cc @@ -223,4 +223,12 @@ void Province::printShortestPath(std::ostream & output) const { } } +/** + * < operator used to compare two roads + * @param road2 A road + * @return True if road1 is shorter in length than road 2 + */ +bool Province::Road::operator < (Road road2) const { + return this->_length < road2._length; +} diff --git a/test-data/project5.out b/test-data/project5.out index 8caeb26..6b241e8 100644 --- a/test-data/project5.out +++ b/test-data/project5.out @@ -43,6 +43,16 @@ The shortest routes from Salem are: ------------------------------------------------ ------------------------------------------------ +The road upgrading goal can be achieved at minimal cost by upgrading: + + Salem to Beverly + Danvers to Beverly + Wenham to Danvers + Salem to Lynn + +------------------------------------------------ +------------------------------------------------ + ------------------------------------------------ ---------------- New DataSet: ------------------ @@ -65,3 +75,10 @@ The shortest routes from Wenham are: ------------------------------------------------ ------------------------------------------------ +The road upgrading goal can be achieved at minimal cost by upgrading: + + Hamilton to Wenham + +------------------------------------------------ +------------------------------------------------ +