blob: fc1eb31258bc43fce7436a4a7cbdf55169e5e998 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#pragma once
#include <vector>
class graph
{
public:
using vertex_t = int;
private:
std::vector<std::vector<vertex_t>> _adjacent;
bool _oriented;
public:
graph(size_t vertex_count, bool is_oriented);
void add_edge(vertex_t from, vertex_t to);
void add_vertex();
size_t vertex_count() const;
bool is_oriented() const;
const std::vector<vertex_t>& adjacent(vertex_t vertex) const;
bool are_adjacent(vertex_t v1, vertex_t v2) const;
};
|