sources/JobAssignment.cpp
/**
 * Prints the 2D costs vector, showcasing all the costs of a job per worker. It also prints which worker
 *      was assigned to which job and the total cost of the solution.
 * 
 * @param[in] &costs the address in memory of the 2D vector that represents the costs of each job per 
 *      worker
 * @param[in] &assignations the address in memory of the 2D vector that represents the job assignations
 * @param[in] jobs the number of jobs
 * @param[in] totalCost the total cost of a solution
*/
Prints the 2D costs vector, showcasing all the costs of a job per worker. It also prints which worker
was assigned to which job and the total cost of the solution.

@param[in] &costs the address in memory of the 2D vector that represents the costs of each job per
worker
@param[in] &assignations the address in memory of the 2D vector that represents the job assignations
@param[in] jobs the number of jobs
@param[in] totalCost the total cost of a solution
Prints the 2D costs vector showcasing all the costs of a job per worker . It also prints which worker was assigned to which job and the total cost of the solution . @param [ in ] &costs the address in memory of the 2D vector that represents the costs of each job per worker @param [ in ] &assignations the address in memory of the 2D vector that represents the job assignations @param [ in ] jobs the number of jobs @param [ in ] totalCost the total cost of a solution
void printResults(vector<vector<int>> &costs, vector<vector<int>> &assignations, int jobs, int totalCost){
    cout << "\nThe following is a worker by costs matrix, where a row represents a worker and a column ";
    cout << "represents the cost of a job: \n" << endl;
    for (int i = 0; i < jobs; i++){
        for (int j = 0; j < jobs; j++){
            cout << "[" << costs[i][j] << "]";
            if (j == jobs - 1){
                cout << endl;
            }
        }
    }
    cout << "\n";
    for (int row = 0; row < jobs; row++){
        for (int col = 0; col < jobs; col++){
            if (assignations[row][col] == 1){
                cout << "Worker " << row + 1 << " was assigned to job " << col + 1 << " with a cost of " 
                    << costs[row][col] << endl;
            }
        } 
    } 
    cout << "\nThe total cost was " << totalCost << endl;
}
void printResults ( vector < vector < int > > & costs , vector < vector < int > > & assignations , int jobs , int totalCost ) { cout << " \n " ; cout << " \n " << endl ; for ( int i = 0 ; i < jobs ; i ++ ) { for ( int j = 0 ; j < jobs ; j ++ ) { cout << " " << costs [ i ] [ j ] << " " ; if ( j == jobs - 1 ) { cout << endl ; } } } cout << " \n " ; for ( int row = 0 ; row < jobs ; row ++ ) { for ( int col = 0 ; col < jobs ; col ++ ) { if ( assignations [ row ] [ col ] == 1 ) { cout << " " << row + 1 << " " << col + 1 << " " << costs [ row ] [ col ] << endl ; } } } cout << " \n " << totalCost << endl ; }
Prints the 2D costs vector, showcasing all the costs of a job per worker.
Prints the 2D costs vector showcasing all the costs of a job per worker .
// Iterate over the rows of the 2D vector // Iterate over the columns of the 2D vector  // If its the last column in the row  //Close if  //Close for //Close for // Iterate over the rows of the 2D vector // Iterate over the columns of the 2D vector  // If an assigned job was found //Close if  //Close for  //Close for 