Delete unused methods
This commit is contained in:
@@ -37,7 +37,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline void Tarjan<T>::strongConnect(const T& v) {
|
void Tarjan<T>::strongConnect(const T& v) {
|
||||||
vp[v].index = vp[v].lowlink = index++;
|
vp[v].index = vp[v].lowlink = index++;
|
||||||
vp[v].onStack = true;
|
vp[v].onStack = true;
|
||||||
S.push(v);
|
S.push(v);
|
||||||
@@ -67,7 +67,7 @@ inline void Tarjan<T>::strongConnect(const T& v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline std::vector<std::vector<T>> Tarjan<T>::run() {
|
std::vector<std::vector<T>> Tarjan<T>::run() {
|
||||||
|
|
||||||
for (const auto& v : G.vertices) {
|
for (const auto& v : G.vertices) {
|
||||||
if (vp[v].index == -1) {
|
if (vp[v].index == -1) {
|
||||||
|
|||||||
@@ -20,37 +20,21 @@ public:
|
|||||||
// Add edge between v and u
|
// Add edge between v and u
|
||||||
void insert(const T& v, const T& u);
|
void insert(const T& v, const T& u);
|
||||||
|
|
||||||
// Delete vertex v
|
|
||||||
void erase(T& v);
|
|
||||||
|
|
||||||
// Delete edge between v and u
|
|
||||||
void erase(T& v, T& u);
|
|
||||||
|
|
||||||
// Adjacency matrix representation
|
// Adjacency matrix representation
|
||||||
std::set<T> vertices;
|
std::set<T> vertices;
|
||||||
std::map<T, std::vector<T>> adjMatrix;
|
std::map<T, std::set<T>> adjMatrix;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline void Graph<T>::insert(const T& v) {
|
void Graph<T>::insert(const T& v) {
|
||||||
vertices.insert(v);
|
vertices.insert(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline void Graph<T>::insert(const T& v, const T& u) {
|
void Graph<T>::insert(const T& v, const T& u) {
|
||||||
vertices.insert(v);
|
vertices.insert(v);
|
||||||
vertices.insert(u);
|
vertices.insert(u);
|
||||||
adjMatrix[v].push_back(u);
|
adjMatrix[v].insert(u);
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline void Graph<T>::erase(T& v) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline void Graph<T>::erase(T& v, T& u) {
|
|
||||||
//
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace graph
|
} // namespace graph
|
||||||
|
|||||||
Reference in New Issue
Block a user