Refactor: Rename adjMatrix to adjList
This commit is contained in:
@@ -48,7 +48,7 @@ void RodittyZwick<T>::init() {
|
||||
|
||||
template<typename T>
|
||||
void RodittyZwick<T>::findSCC() {
|
||||
auto SCCs = Tarjan<T>(this->G.adjMatrix).execute();
|
||||
auto SCCs = Tarjan<T>(this->G.adjList).execute();
|
||||
|
||||
for (auto& SCC : SCCs) {
|
||||
const auto& w = SCC.id;
|
||||
@@ -78,8 +78,8 @@ void RodittyZwick<T>::remove(const T& u, const T& v) {
|
||||
if (A[u] != A[v]) return;
|
||||
|
||||
// If edge (u,v) is not contained in both inTree and outTree do nothing
|
||||
if (!In[w].adjMatrix[u].contains(v) &&
|
||||
!Out[w].adjMatrix[u].contains(v))
|
||||
if (!In[w].adjList[u].contains(v) &&
|
||||
!Out[w].adjList[u].contains(v))
|
||||
return;
|
||||
|
||||
// Update In(w) and Out(w)
|
||||
@@ -87,7 +87,7 @@ void RodittyZwick<T>::remove(const T& u, const T& v) {
|
||||
In[w] = BreadthFirstTree<T>(C[w].reverse(), w);
|
||||
|
||||
// If a SCC is broken, compute all SCCs again
|
||||
if (!In[w].adjMatrix.count(u) || !Out[w].adjMatrix.count(v))
|
||||
if (!In[w].adjList.count(u) || !Out[w].adjList.count(v))
|
||||
findSCC();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user