2022-04-17 00:03:38 +00:00
|
|
|
|
2022-04-18 03:03:17 +00:00
|
|
|
class graph {
|
|
|
|
public:
|
|
|
|
// Constructors
|
2022-04-22 23:48:36 +00:00
|
|
|
graph() {}
|
2022-04-18 03:03:17 +00:00
|
|
|
graph(const int processes, const int resources);
|
|
|
|
// Initializers:
|
2022-04-22 23:48:36 +00:00
|
|
|
void read(std::string filename);
|
2022-04-18 03:03:17 +00:00
|
|
|
// check functions:
|
|
|
|
// is the graph...
|
|
|
|
bool reducible();// ?
|
|
|
|
bool knotted();// ?
|
2022-04-22 23:48:36 +00:00
|
|
|
|
|
|
|
struct m{
|
|
|
|
int x, y;
|
|
|
|
std::vector<std::vector<int>> data;
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
int num_processes = 0;
|
|
|
|
int num_resources = 0;
|
|
|
|
std::vector<int> resource_counts;
|
|
|
|
struct m matrix; // Tell me, Mr. Anderson, what good is a phone call if you are unable to speak?
|
|
|
|
bool is_blocked(int process_id);
|
2022-04-18 03:03:17 +00:00
|
|
|
};
|