Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <fstream>
- #include "Structure.h"
- using namespace std;
- Structure structure;
- int main() {
- char choice = NULL;
- while (choice != '0') {
- if (choice == '0' || choice == '1' || choice == '2' || choice == '3' || choice == '4' || choice == '5' || choice == NULL) {
- cout << "\n1. Load data from file\n";
- cout << "2. Randomize data\n";
- cout << "3. Brute Force\n";
- cout << "4. Branch & Bound\n";
- cout << "5. Dynamic Programming\n";
- cout << "0. Exit\n";
- }
- choice = _getch();
- if (choice == 'x00')
- choice = _getch();
- switch (choice) {
- case '1':
- system("CLS");
- cout << endl << "Data has been loaded: \n\n";
- structure.read_from_file("tsp_17.txt");
- structure.displayStructure();
- break;
- case '2':
- system("CLS");
- cout << endl << "Data has been randomized." << endl;
- break;
- case '3':
- system("CLS");
- structure.TSP(0);
- structure.displayResult();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement