-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaxstronglyconnectedcomponent.h
More file actions
29 lines (25 loc) · 1.05 KB
/
maxstronglyconnectedcomponent.h
File metadata and controls
29 lines (25 loc) · 1.05 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
#ifndef MAXSTRONGLYCONNECTEDCOMPONENT_H
#define MAXSTRONGLYCONNECTEDCOMPONENT_H
#include "directedgraph.h"
/**
* @brief The MaxStronglyConnectedComponent class
* Klasa realizuje zadanie nr 2 z zestawu IV
*/
class MaxStronglyConnectedComponent
{
private:
MaxStronglyConnectedComponent();
public:
// metoda znajduje najwieksza silnie spojna skladowa
// tworzy z niej nowy digraf i zwraca go
static DirectedGraph* getMaxStronglyConnectedComponent(DirectedGraph* diGraphTmp);
// metoda sprawdza, czy digraf zawiera cykl ujemny
static bool hasNegativeCycle(DirectedGraph* diGraph);
// efektem metody jest wypelnienie tablicy distance odleglosciami
// uwaga: ta metoda numeruje wszystkie wierzcholki od 0
// uzywany jest algorytm Bellmana-Forda
// zwraca true jezeli graf nie zawiera cykli ujemnych, w przeciwnym wypadku false
// zwraca takze false, jezeli digraf ma 0 wierzcholkow
static bool getDistances(DirectedGraph* diGraph, unsigned int sVertex, std::vector<int>& distances);
};
#endif // MAXSTRONGLYCONNECTEDCOMPONENT_H