23 lines
611 B
C++
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;
|
|
}
|