-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.hpp
More file actions
41 lines (36 loc) · 1.15 KB
/
Copy pathgraph.hpp
File metadata and controls
41 lines (36 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <vector>
#include <utility>
#include <string>
#include <iostream>
class Graph {
public:
int n;
double maxDist;
std::vector<std::vector<std::pair<int,double>>> adj_lists;
Graph() {};
void parse_graph(const std::string& filename);
int maxDeg();
void print(std::ostream& os = std::cout) const
{
os << "Graph: " << n << " vertices \n ";
for (int u = 0; u < n; ++u)
{
os << u << ": ";
bool first = true;
for (const auto& [v, w] : adj_lists[u])
{
if (!first) os << ", ";
first = false;
os << v << '(' << w << ')';
}
os << '\n';
}
}
};
std::vector<int> AlgL(int n, int m);
void randomGraph(int n, int m, Graph& G);
std::vector<int> merge(std::vector<int> sorted, std::vector<int> vec,int m);
void RMAT1loop(int n, int m, std::vector<long long>& to_add);
void RMAT1(int n, int m, Graph& G);
void wideWeightRandomGraph(int n, int m, double min_w, double max_w, Graph& G);