rhinodavid / scc

A Golang app to find the strongly connected components of a directed graph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SCC

Overview

This application computes the strongly connected components of a directed graph using Kosaraju's two-pass algorithm.

Input format

See test_graph.txt for a sample input. Each line on the input file represents one edge of the graph. Nodes are labeled by integers, and each edge consists of the label of the tail node followed by the label of the head node.

The sample graph in test_graph.txt is depicted below, with the strongly connected components circled in red.

Usage

Run go run main.go <GRAPH_FILE.txt>. The output will be the population of the top five most populous strongly connected components.

About

A Golang app to find the strongly connected components of a directed graph


Languages

Language:Go 100.0%