Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
assignment210ct/graph.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
21 lines (18 sloc)
542 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _GRAPH_H | |
#define _GRAPH_H | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include "helper.h" | |
class Graph { | |
std::vector< std::vector<bool> > connections; | |
public: | |
Graph(const int &numberOfNodes); | |
void connectNodes(const int &node1, const int &node2); | |
void disconnectNodes(const int &node1, const int &node2); | |
void printAdjacencyMatrix(); | |
bool isPath(const int &node1, const int &node2); | |
bool searchPath(const int &node1, const int &node2, std::vector<int> *visitedNodes); | |
bool isConnected(); | |
}; | |
#endif //_GRAPH_H |