An open API service indexing awesome lists of open source software.

https://github.com/jessepollak/graph-colorer

A graph coloring script I wrote for my Discrete Mathematics class
https://github.com/jessepollak/graph-colorer

Last synced: 3 months ago
JSON representation

A graph coloring script I wrote for my Discrete Mathematics class

Awesome Lists containing this project

README

        

#Graph Colorer

This is a script for coloring a graph created for my Discrete Mathematics class.

To use, enter:

ruby graph_colorer.rb graph.txt

Input format: the input file will have one line with the number of vertices and the number of edges. There will then be one line for each edge, each line will contain two integers identifying the endpoints, the smaller number will be listed first.

INPUT:

5 6
1 2
1 4
1 5
2 4
2 5
3 4

OUTPUT:

1 1
2 2
3 1
4 3
5 3