Strongly connected component

Graph with strongly connected components marked

In the mathematical theory of directed graphs, a graph is said to be strongly connected if every vertex is reachable from every other vertex. The strongly connected components of a directed graph form a partition into subgraphs that are themselves strongly connected. It is possible to test the strong connectivity of a graph, or to find its strongly connected components, in linear time (that is, Θ(V + E )).

Definitions

A directed graph is called strongly connected if there is a path in each direction between each pair of vertices of the graph. That is, a path exists from the first vertex in the pair to the second, and another path exists from the second vertex to the first. In a directed graph G that may not itself be strongly connected, a pair of vertices u and v are said to be strongly connected to each other if there is a path in each direction between them.

The binary relation of being strongly connected is an equivalence relation, and the induced subgraphs of its equivalence classes are called strongly connected components. Equivalently, a strongly connected component of a directed graph G is a subgraph that is strongly connected, and is maximal with this property: no additional edges or vertices from G can be included in the subgraph without breaking its property of being strongly connected. The collection of strongly connected components forms a partition of the set of vertices of G. A strongly connected component C is called trivial when C consists of a single vertex which is not connected to itself with an edge, and non-trivial otherwise.[1]

The yellow directed acyclic graph is the condensation of the blue directed graph. It is formed by contracting each strongly connected component of the blue graph into a single yellow vertex.

If each strongly connected component is contracted to a single vertex, the resulting graph is a directed acyclic graph, the condensation of G. A directed graph is acyclic if and only if it has no strongly connected subgraphs with more than one vertex, because a directed cycle is strongly connected and every non-trivial strongly connected component contains at least one directed cycle.

Algorithms

DFS-based linear-time algorithms

Several algorithms based on depth-first search compute strongly connected components in linear time.

  • Kosaraju's algorithm uses two passes of depth-first search. The first, in the original graph, is used to choose the order in which the outer loop of the second depth-first search tests vertices for having been visited already and recursively explores them if not. The second depth-first search is on the transpose graph of the original graph, and each recursive exploration finds a single new strongly connected component.[2][3] It is named after S. Rao Kosaraju, who described it (but did not publish his results) in 1978; Micha Sharir later published it in 1981.[4]
  • Tarjan's strongly connected components algorithm, published by Robert Tarjan in 1972,[5] performs a single pass of depth-first search. It maintains a stack of vertices that have been explored by the search but not yet assigned to a component, and calculates "low numbers" of each vertex (an index number of the highest ancestor reachable in one step from a descendant of the vertex) which it uses to determine when a set of vertices should be popped off the stack into a new component.
  • The path-based strong component algorithm uses a depth-first search, like Tarjan's algorithm, but with two stacks. One of the stacks is used to keep track of the vertices not yet assigned to components, while the other keeps track of the current path in the depth-first search tree. The first linear time version of this algorithm was published by Edsger W. Dijkstra in 1976.[6]

Although Kosaraju's algorithm is conceptually simple, Tarjan's and the path-based algorithm require only one depth-first search rather than two.

Reachability-based algorithms

Previous linear-time algorithms are based on depth-first search which is generally considered hard to parallelize. Fleischer et al.[7] in 2000 proposed a divide-and-conquer approach based on reachability queries, and such algorithms are usually called reachability-based SCC algorithms. The idea of this approach is to pick a random pivot vertex and apply forward and backward reachability queries from this vertex. The two queries partition the vertex set into 4 subsets: vertices reached by both, either one, or none of the searches. One can show that a strongly connected component has to be contained in one of the subsets. The vertex subset reached by both searches forms a strongly connected component, and the algorithm then recurses on the other 3 subsets.

The expected sequential running time of this algorithm is shown to be O(n log n), a factor of O(log n) more than the classic algorithms. The parallelism comes from: (1) the reachability queries can be parallelized more easily (e.g. by a breadth-first search (BFS), and it can be fast if the diameter of the graph is small); and (2) the independence between the subtasks in the divide-and-conquer process. This algorithm performs well on real-world graphs,[3] but does not have theoretical guarantee on the parallelism (consider if a graph has no edges, the algorithm requires O(n) levels of recursions).

Blelloch et al.[8] in 2016 shows that if the reachability queries are applied in a random order, the cost bound of O(n log n) still holds. Furthermore, the queries then can be batched in a prefix-doubling manner (i.e. 1, 2, 4, 8 queries) and run simultaneously in one round. The overall span of this algorithm is log2n reachability queries, which is probably the optimal parallelism that can be achieved using the reachability-based approach.

Generating random strongly connected graphs

Peter M. Maurer describes an algorithm for generating random strongly connected graphs,[9] based on a modification of an algorithm for strong connectivity augmentation, the problem of adding as few edges as possible to make a graph strongly connected. When used in conjunction with the Gilbert or Erdős-Rényi models with node relabelling, the algorithm is capable of generating any strongly connected graph on n nodes, without restriction on the kinds of structures that can be generated.

Applications

Algorithms for finding strongly connected components may be used to solve 2-satisfiability problems (systems of Boolean variables with constraints on the values of pairs of variables): as Aspvall, Plass & Tarjan (1979) showed, a 2-satisfiability instance is unsatisfiable if and only if there is a variable v such that v and its negation are both contained in the same strongly connected component of the implication graph of the instance.[10]

Strongly connected components are also used to compute the Dulmage–Mendelsohn decomposition, a classification of the edges of a bipartite graph, according to whether or not they can be part of a perfect matching in the graph.[11]

A directed graph is strongly connected if and only if it has an ear decomposition, a partition of the edges into a sequence of directed paths and cycles such that the first subgraph in the sequence is a cycle, and each subsequent subgraph is either a cycle sharing one vertex with previous subgraphs, or a path sharing its two endpoints with previous subgraphs.

According to Robbins' theorem, an undirected graph may be oriented in such a way that it becomes strongly connected, if and only if it is 2-edge-connected. One way to prove this result is to find an ear decomposition of the underlying undirected graph and then orient each ear consistently.[12]

See also

References

  1. ^ Nuutila, Esko; Soisalon-Soininen, Eljas (1994), "On finding the strongly connected components in a directed graph", Information Processing Letters, 49 (1): 9–14, doi:10.1016/0020-0190(94)90047-7
  2. ^ Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0-262-03293-7. Section 22.5, pp. 552–557.
  3. ^ a b Hong, Sungpack; Rodia, Nicole C.; Olukotun, Kunle (2013), "On fast parallel detection of strongly connected components (SCC) in small-world graphs" (PDF), Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis - SC '13, pp. 1–11, doi:10.1145/2503210.2503246, ISBN 9781450323789, S2CID 2156324
  4. ^ Sharir, Micha (1981), "A strong-connectivity algorithm and its applications in data flow analysis", Computers & Mathematics with Applications, 7: 67–72, doi:10.1016/0898-1221(81)90008-0
  5. ^ Tarjan, R. E. (1972), "Depth-first search and linear graph algorithms", SIAM Journal on Computing, 1 (2): 146–160, doi:10.1137/0201010, S2CID 16467262
  6. ^ Dijkstra, Edsger (1976), A Discipline of Programming, NJ: Prentice Hall, Ch. 25.
  7. ^ Fleischer, Lisa K.; Hendrickson, Bruce; Pınar, Ali (2000), "On Identifying Strongly Connected Components in Parallel" (PDF), Parallel and Distributed Processing, Lecture Notes in Computer Science, vol. 1800, pp. 505–511, doi:10.1007/3-540-45591-4_68, ISBN 978-3-540-67442-9
  8. ^ Blelloch, Guy E.; Gu, Yan; Shun, Julian; Sun, Yihan (2016), "Parallelism in Randomized Incremental Algorithms" (PDF), Proceedings of the 28th ACM Symposium on Parallelism in Algorithms and Architectures - SPAA '16, pp. 467–478, doi:10.1145/2935764.2935766, hdl:1721.1/146176, ISBN 9781450342100.
  9. ^ Maurer, P. M. (February 2018), Generating strongly connected random graphs (PDF), Int'l Conf. Modeling, Sim. and Vis. Methods MSV'17, CSREA Press, ISBN 978-1-60132-465-8, retrieved December 27, 2019
  10. ^ Aspvall, Bengt; Plass, Michael F.; Tarjan, Robert E. (1979), "A linear-time algorithm for testing the truth of certain quantified boolean formulas", Information Processing Letters, 8 (3): 121–123, doi:10.1016/0020-0190(79)90002-4.
  11. ^ Dulmage, A. L. & Mendelsohn, N. S. (1958), "Coverings of bipartite graphs", Can. J. Math., 10: 517–534, doi:10.4153/cjm-1958-052-0, S2CID 123363425.
  12. ^ Robbins, H. E. (1939), "A theorem on graphs, with an application to a problem on traffic control", American Mathematical Monthly, 46 (5): 281–283, doi:10.2307/2303897, JSTOR 2303897.

Read other articles:

Cet article est une ébauche concernant l’Allemagne. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Chronologie de l’Allemagne ◄◄ 2005 2006 2007 2008 2009 2010 2011 2012 2013 Chronologies Données clés 2005 2006 2007  2008  2009 2010 2011Décennies :1970 1980 1990  2000  2010 2020 2030Siècles :XIXe XXe  XXIe  XXIIe XXIIIeMillénaires :Ier IIe  IIIe ...

Charlotte Court House Localidad Charlotte Court HouseLocalización de Charlotte Court House en Virginia Charlotte Court HouseLocalización de Charlotte Court House en Estados UnidosCoordenadas 37°03′25″N 78°38′03″O / 37.0569, -78.6342Entidad Localidad • País  Estados Unidos • Estado  Virginia • Condado CharlotteSuperficie   • Total 10,3 km² • Tierra 10,3 km² • Agua 0,0 km²Altitud   • Media 189 m...

Shire of Mundaring Local Government Area van Australië Locatie van Shire of Mundaring in Perth Situering Staat West-Australië Hoofdplaats Mundaring Coördinaten 31°53'49ZB, 116°10'16OL Algemene informatie Oppervlakte 644,9 km² Inwoners 39.166 (2021)[1] Overig Wards 4 Website http://www.mundaring.wa.gov.au/ (en) Portaal    Australië Shire of Mundaring is een Local Government Area (LGA) in Australië in de staat West-Australië in de agglomeratie van Perth. Shire of Mund...

Monumental statue in Chicago, Illinois, US Richard J. Oglesby statueRichard J. Oglesby statue (2011)41°55′48.58″N 87°38′13.45″W / 41.9301611°N 87.6370694°W / 41.9301611; -87.6370694LocationLincoln Park, Chicago, Illinois, United StatesDesignerLeonard CrunelleMaterialBronzeGranite (pedestal)Dedicated date1919Dedicated toRichard J. Oglesby The Richard J. Oglesby statue is a monumental statue of Richard J. Oglesby in Chicago, Illinois, United States....

この項目には、一部のコンピュータや閲覧ソフトで表示できない文字(丸数字(イラスト者「ぽんかん⑧」))が含まれています(詳細)。 やはり俺の青春ラブコメはまちがっている。 テレビアニメ版のロゴ ジャンル 学園[1]、ラブコメ 小説 著者 渡航 イラスト ぽんかん⑧ 出版社 小学館 レーベル ガガガ文庫 刊行期間 2011年3月18日 - 巻数 既刊20巻(2023年2月現在...

السحب الزائد هو عملية استخراج المياه الجوفية بما يتجاوز التصريف المتوازن لطبقات المياه الجوفية. هناك نوعان من التصريف: التصريف المأمون والتصريف المستدام. التصريف المأمون هو كمية المياه الجوفية الممكن سحبها من الأرض دون أي نتائج غير مرغوبة. أما التصريف المستدام، فهو استخر...

Danish general (1743–1817) A portrait of Castenschiold General Joachim Melchior Holten von Castenschiold (29 November 1743 – 6 April 1817) was a Danish Army officer who served during the Napoleonic Wars. Castenschiold purchased Borreby Castle in 1783, the estate of which has been owned by the family ever since. Biography He was son of slaveholding planter Johan Lorentz Castenschiold and his wife Jacoba von Holten. In 1760, Castenschiold enlisted in the Royal Danish Army as an officer at t...

German politician, essayist and trade unionist August WinnigOberpräsident of East PrussiaIn office1919–1920Generalbevollmächtigter to the Baltic ProvincesIn office1917–1918Reichskommissar for East and West PrussiaIn office1917–1918Member of the Landtag of Hamburg (SPD)In office1913–1921 Personal detailsBorn(1878-03-31)31 March 1878BlankenburgDied3 November 1956(1956-11-03) (aged 78)Bad NauheimNationalityGermanPolitical party Social Democratic Party (1896–1920) Old Social Demo...

66th Governor of Georgia (1931–1933), U.S. Senator from Georgia (1933–1971) For other people named Richard Russell, see Richard Russell (disambiguation). Richard Russell Jr.President pro tempore of the United States SenateIn officeJanuary 3, 1969 – January 21, 1971Preceded byCarl HaydenSucceeded byAllen J. EllenderChair of the Senate Committee on AppropriationsIn officeJanuary 3 , 1969 – January 21, 1971LeaderMike MansfieldPreceded byCarl HaydenSucceeded byAllen Elle...

Ricardo Cabanas Informasi pribadiNama lengkap Ricardo Cabanas-ReyTanggal lahir 17 Januari 1979 (umur 44)Tempat lahir Zürich, SwissTinggi 1,73 m (5 ft 8 in)Posisi bermain GelandangInformasi klubKlub saat ini Grasshopper Club ZürichNomor 15Karier junior1986–1992 SCI Juventus Zürich1992–1997 Grasshopper Club ZürichKarier senior*Tahun Tim Tampil (Gol)1997–2006 Grasshopper Club Zürich 198 (42)2003–2004 → Guingamp (pinjaman) 17 (0)2006–2007 1. FC Köln 41 (2)200...

American TV series or program The Superman/Aquaman Hour of AdventureGenreSuperheroBased on Supermanby Jerry Siegel    Joe Shuster Aquamanby Paul Norris    Mort Weisinger Directed byHal SutherlandVoices ofBud CollyerMarvin MillerTed KnightCountry of originUnited StatesNo. of episodes36ProductionExecutive producerAllen DucovnyProducersNorm PrescottLou ScheimerRunning time60 minutesProduction companiesFilmationDucovny ProductionsNational Periodical Pu...

The Asia Swimming Federation (AASF)[1] oversees international aquatics competitions in Asia, and is affiliated to the Olympic Council of Asia[2] and to FINA. It was founded in 1978 in Bangkok;[1] and currently has its administrative headquarters in Muscat, Oman. As of August 2009, the AASF President is Sheikh Khalid Mohammed Al Badr Al Sabah of Kuwait.[2] Members Further information: Category:National members of the Asian Swimming Federation Asian FINA Members ...

Gerbang depan Neoklasik (1841-1843) yang dirancang oleh Pierre Bourla Akademi Seni Rupa Kerajaan Antwerpen (Belanda: Koninklijke Academie voor Schone Kunsten van Antwerpen) adalah sebuah akademi seni rupa yang terletak di Antwerp, Belgia. Akademi tersebut adalah salah satu yang tertua dari jenisnya di Eropa. Akademi tersebut didirikan pada 1663 oleh David Teniers the Younger, pelukis dari Leopold Wilhelm dan Don Juan dari Austria. Alumni terkenal Willis Seaver Adams Lawrence Alma-Tadema W...

This article is about a rural municipality in Syangja. For other uses, see Kaligandaki. Gaupalika in Gandaki Province, NepalKaligandaki कालिगण्डकीGaupalika Phedikhola Arjunchaupari Kaligandaki Bhirkot Waling Galyang Harinas Biruwa Chapakot Putalibazar Aandhikhola Kaligandaki in Syangja DistrictKaligandakiLocation in Gandaki ProvinceShow map of Gandaki ProvinceKaligandakiKaligandaki (Nepal)Show map of NepalCoordinates: 27°57′13″N 83°30′44″E / 27.95...

This article uses bare URLs, which are uninformative and vulnerable to link rot. Please consider converting them to full citations to ensure the article remains verifiable and maintains a consistent citation style. Several templates and tools are available to assist in formatting, such as reFill (documentation) and Citation bot (documentation). (August 2022) (Learn how and when to remove this template message) Looney Tunes Super Stars is a series of nine Looney Tunes DVDs consisting of two Bu...

Kereta Api SriwijayaKereta api Limex Sriwijaya saat berada di Stasiun Tanjung KarangInformasi umumJenis layananKereta Api AntarkotaStatusFakultatif (menunggu rangkaian kereta terlebih dahulu sebelum berjalan saat hari tertentu)Daerah operasiDivisi Regional IV TanjungkarangPendahuluFajar Utama LampungMulai beroperasi1 Juni 1967 (1967-06-01) (56 tahun, 189 hari)Operator saat iniKereta Api IndonesiaLintas pelayananStasiun awalTanjungkarangJumlah pemberhentianLihatlah di bawah.Stas...

Genus of moths Epermenia Epermenia illigerella Scientific classification Domain: Eukaryota Kingdom: Animalia Phylum: Arthropoda Class: Insecta Order: Lepidoptera Family: Epermeniidae Genus: EpermeniaHübner, [1825] Synonyms Epermenia Hübner, [1825] Calotripis Hübner, [1825] Trichotrips Hübner, [1825] Chaudiodus Treitschke, 1833 (preocc. Schneider, 1810) Lophonotus Stephens, 1834 Chauliomorpha Blanchard, 1840 Heydenia Hofmann, 1868 (preocc. Foerster, 1856) Cataplectica Walsingham, 1894 Acan...

2005 filmPerpetual MotionTraditional Chinese無窮動Simplified Chinese无穷动Hanyu PinyinWú qiōng dòng Directed byNing YingWritten byHung HuangLiu SolaNing YingProduced byFrancesco CosentinoNing YingStarringHung HuangLi QinqinLiu SolaPing YanniCinematographyAndrea CavazzutiNing YingEdited byNing YingMusic byLiu SolaRelease date September 10, 2005 (2005-09-10) (Toronto) Running time90 minutesLanguageMandarin Perpetual Motion is an independent Chinese film directed...

ニュー・ミュージカル・エクスプレス New Musical Express 愛称・略称 NMEジャンル 音楽雑誌刊行頻度 週刊発売国 イギリス言語 英語出版社 IPC Media (Time Inc.)ISSN 0028-6362刊行期間 1952年3月7日 - 2018年3月9日(紙媒体)オンラインで刊行継続ウェブサイト www.nme.comテンプレートを表示 『ニュー・ミュージカル・エクスプレス』(New Musical Express)は、イギリスの週刊音楽雑誌、週刊新...

2006 Indian filmEm MaganDVD coverDirected byThirumuruganWritten byBhaskar Sakthi (dialogue)Screenplay byThirumuruganStory byThirumuruganProduced byT. G. Thyagarajan Selvi ThyagarajanStarringBharathGopikaNassarVadiveluSaranya PonvannanGajalaCinematographySevilo RajaEdited byJeyakumarMusic byVidyasagarProductioncompanySathya Jyothi FilmsDistributed bySathya MoviesRelease date7 September 2006CountryIndiaLanguageTamil Em Magan (transl. My son) is a 2006 Indian Tamil-language family drama fi...