Skip to content

Converts popular graph description format used in programming competitions (ACM, topcoder, Yandex.contest) to Graphviz (*.dot) file format

Notifications You must be signed in to change notification settings

2xmax/contest2graphviz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

contest2graphviz util

Converts popular graph description format used in programming competitions (ACM, topcoder, Yandex.contest) to Graphviz (*.dot) file format.

Input format:

V E
u_1 v_1 [optional weight1]
u_2 v_2 [optional weight2]
...

Example

Input file

5 5
1 2 2
2 3 54
3 4 76
5 3 8
1 5 5

will be converted to this dot file

digraph G {
	1 -> 2 [label="2"]
	2 -> 3 [label="54"]
	3 -> 4 [label="76"]
	5 -> 3 [label="8"]
	1 -> 5 [label="5"]
}

How to use

  1. Install graphviz (e.g by sudo apt-get install -y graphviz or sudo yum install -y graphviz)
  2. ./graphviz.sh sample.in

It will produce DOT and PNG files.

About

Converts popular graph description format used in programming competitions (ACM, topcoder, Yandex.contest) to Graphviz (*.dot) file format

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages