Skip to content
Permalink
master
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
#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