Refactor: Rename adjMatrix to adjList

This commit is contained in:
stefiosif
2022-10-12 16:57:48 +03:00
parent 8b6d341d18
commit c525aeaa43
14 changed files with 56 additions and 56 deletions

View File

@@ -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();
}