4600-project-2/src/graph.cpp
2022-04-17 18:29:32 -05:00

23 lines
611 B
C++

#include <cstdlib>
#include "graph.hpp"
int graph_reduce(struct adjmatrix *graph) {
// TODO: Implement a function which checks if a process is blocked
// TODO: Use that function to implement the graph reduction algorithm
//? Make sure when reducing the graph, you don't try to delete the
return 0;
}
int knot_detect(struct adjmatrix *graph) {
return 0;
}
int destroy_adjmatrix(struct adjmatrix *matrix) {
for (int i = 0; i < matrix->num_processes + matrix->num_resources; i++) {
free(matrix->matrix[i]);
}
free(matrix->matrix);
free(matrix->resource_counts);
return 0;
}