Skip to content

Commit 783512e

Browse files
goswami-rahuljakobkogler
authored andcommitted
update old links (#276)
1 parent c284c3c commit 783512e

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ e-maxx-eng
99

1010
Translation of http://e-maxx.ru into English
1111

12-
Compiled pages are published at http://e-maxx-eng.appspot.com/
12+
Compiled pages are published at https://cp-algorithms.com/
1313

14-
Manual for contributors: http://e-maxx-eng.appspot.com/contrib.html
14+
Manual for contributors: https://cp-algorithms.com/contrib.html
1515

16-
Test-your-page form: http://e-maxx-eng.appspot.com/test.php
16+
Test-your-page form: https://cp-algorithms.com/test.php

src/combinatorics/generating_combinations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bool next_combination(vector<int>& a, int n) {
3434
This time we want to generate all $K$-combinations in such
3535
an order, that adjacent combinations differ exactly by one element.
3636
37-
This can be solved using the [Gray Code](https://e-maxx-eng.appspot.com/algebra/gray-code.html):
37+
This can be solved using the [Gray Code](./algebra/gray-code.html):
3838
If we assign a bitmask to each subset, then by generating and iterating over these bitmasks with Gray codes, we can obtain our answer.
3939
4040
The task of generating $K$-combinations can also be solved using Gray Codes in a different way:

src/contrib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
We collaborate via means of github.
88

9-
Generated pages are compiled and published at [http://e-maxx-eng.appspot.com](http://e-maxx-eng.appspot.com).
9+
Generated pages are compiled and published at [https://cp-algorithms.com](https://cp-algorithms.com).
1010

1111
And sources (to which you may want to contribute) are [here](http://github.com/e-maxx-eng/e-maxx-eng/tree/master/src).
1212

src/graph/strongly-connected-components.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You are given a directed graph $G$ with vertices $V$ and edges $E$. It is possib
99
$$
1010
u \mapsto v, v \mapsto u
1111
$$
12-
where $\mapsto$ means reachability, i.e. existance of the path from first vertex to the second.
12+
where $\mapsto$ means reachability, i.e. existence of the path from first vertex to the second.
1313

1414
It is obvious, that strongly connected components do not intersect each other, i.e. this is a partition of all graph vertices. Thus we can give a definition of condensation graph $G^{SCC}$ as a graph containing every strongly connected component as one vertex. Each vertex of the condensation graph corresponds to the strongly connected component of graph $G$. There is an oriented edge between two vertices $C_i$ and $C_j$ of the condensation graph if and only if there are two vertices $u \in C_i, v \in C_j$ such that there is an edge in initial graph, i.e. $(u, v) \in E$.
1515

@@ -18,7 +18,7 @@ The most important property of the condensation graph is that it is **acyclic**.
1818
The algorithm described in the next section extracts all strongly connected components in a given graph. It is quite easy to build a condensation graph then.
1919

2020
## Description of the algorithm
21-
Described algorithm was independently suggested by Kosaraju and Sharir at 1979. This is an easy-to-implement algorithm based on two series of [depth first search](http://e-maxx-eng.appspot.com/graph/depth-first-search.html), and working for $O(n + m)$ time.
21+
Described algorithm was independently suggested by Kosaraju and Sharir at 1979. This is an easy-to-implement algorithm based on two series of [depth first search](./graph/depth-first-search.html), and working for $O(n + m)$ time.
2222

2323
**On the first step** of the algorithm we are doing sequence of depth first searches, visiting the entire graph. We start at each vertex of the graph and run a depth first search from every non-visited vertex. For each vertex we are keeping track of **exit time** $tout[v]$. These exit times have a key role in an algorithm and this role is expressed in next theorem.
2424

@@ -28,7 +28,7 @@ First, let's make notations: let's define exit time $tout[C]$ from the strongly
2828

2929
There are two main different cases at the proof depending on which component will be visited by depth first search first, i.e. depending on difference between $tin[C]$ and $tin[C']$:
3030
** The component $C$ was reached first. It means that depth first search comes at some vertex $v$ of component $C$ at some moment, but all other vertices of components $C$ and $C'$ were not visited yet. By condition there is an edge $(C, C')$ in a condensation graph, so not only the entire component $C$ is reachable from $v$ but the whole component $C'$ is reachable as well. It means that depth first search that is running from vertex $v$ will visit all vertices of components $C$ and $C'$, so they will be descendants for $v$ in a depth first search tree, i.e. for each vertex $u \in C \cup C', u \ne v$ we have that $tout[v] > tout[u]$, as we claimed.
31-
** Assume that component $C'$ was visited first. Similarly, depth first search comes at some vertex $v$ of component $C'$ at some moment, but all other vertices of components $C$ and $C'$ were not visited yet. But by condition there is an edge $(C, C')$ in the condensation graph, so, because of acyclic propery of condensation graph, there is no back path from $C'$ to $C$, i.e. depth first search from vertex $v$ will not reach vertices of $C$. It means that vertices of $C$ will be visited by depth first search later, so $tout[C] > tout[C']$. This completes the proof.
31+
** Assume that component $C'$ was visited first. Similarly, depth first search comes at some vertex $v$ of component $C'$ at some moment, but all other vertices of components $C$ and $C'$ were not visited yet. But by condition there is an edge $(C, C')$ in the condensation graph, so, because of acyclic property of condensation graph, there is no back path from $C'$ to $C$, i.e. depth first search from vertex $v$ will not reach vertices of $C$. It means that vertices of $C$ will be visited by depth first search later, so $tout[C] > tout[C']$. This completes the proof.
3232

3333
Proved theorem is **the base of algorithm** for finding strongly connected components. It follows that any edge $(C, C')$ in condensation graph comes from a component with a larger value of $tout$ to component with a smaller value.
3434

@@ -44,9 +44,9 @@ Thus, we built next **algorithm** for selecting strongly connected components:
4444

4545
2nd step. Build transposed graph $G^T$. Run a series of depth (breadth) first searches in the order determined by list $order$ (to be exact in reverse order, i.e. in decreasing order of exit times). Every set of vertices, reached after the next search, will be the next strongly connected component.
4646

47-
Algorithm asymptotics is $O(n + m)$, because it is just two depth (breadth) first searches.
47+
Algorithm asymptotic is $O(n + m)$, because it is just two depth (breadth) first searches.
4848

49-
Finally, it is appropriate to mention [topological sort](http://e-maxx-eng.appspot.com/graph/topological-sort.html) here. First of all, step 1 of the algorithm represents topological sort of graph $G$ (actually this is exactly what vertices' sort by exit time means). Secondly, the algorithm's scheme generates strongly connected components by decreasing order of their exit times, thus it generates components - vertices of condensation graph - in topological sort order.
49+
Finally, it is appropriate to mention [topological sort](./graph/topological-sort.html) here. First of all, step 1 of the algorithm represents topological sort of graph $G$ (actually this is exactly what vertices' sort by exit time means). Secondly, the algorithm's scheme generates strongly connected components by decreasing order of their exit times, thus it generates components - vertices of condensation graph - in topological sort order.
5050

5151
## Implementation
5252
```cpp

0 commit comments

Comments
 (0)