Skip to content
Permalink
3926ba983b
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
20 lines (17 sloc) 582 Bytes
#ifndef _WEIGHTED_GRAPH_H
#define _WEIGHTED_GRAPH_H
#include <iostream>
#include <vector>
#include <algorithm>
#include "helper.h"
class WeightedGraph {
std::vector< std::vector<int> > connections;
public:
WeightedGraph(const int &numberOfNodes);
void connectNodes(const int &node1, const int &node2, const int &weight);
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);
};
#endif //_WEIGHTED_GRAPH_H