Saturday, May 16, 2015

Minimal network | Euler 107

This problem involves a graph algorithm which is known as Kruskal's algorithm which tries to minimize the sum of values associated with vertices in a graph.

Edges are sorted and then added to a list if it does not violate the rule of minimal graph, which has no closed loops. For this the item is checked whether the vertices are already there in the completed vertices.

This is a simple algorithm and is implemented below with python language. This is a link for the input text file.

Square root digital expansion | Euler 80

Roman Numerals | Euler 89

This problem focuses on generating optimum Roman Numeral representation. The python code is provided and text file contains the input text. These are the rules associated with Roman Numbers

getMin() function returns the minimized roman numeral and getNum() function returns the value of the roman numeral in international format.