My project in Web application field – Graph colouring Algorithm

Today the web applications have a great value. Anyone can access the application and do their jobs through the web. Hosting the application require a server, that manages the request and stores the data. Here the google appengine does the job. Google app engine is a cloud environment that provides the server-side services we want. Here the application is a graph colouring technique which takes a graph and provides a proper colour to each of the nodes according to the vertex colouring algorithm. This algorithm is implemented in python.

The front end of the project is a HTML5 page. It uses the web application languages javascript and jquery. Here the front-end consists of a html5 canvas and the control buttons. We can draw an undirected graph in the canvas using the control buttons. These buttons are created in html5 page. The program code resides in two files. One html5 file and one javascript file.

My graph colouring canvas

A html5 canvas is created using the canvas tag in html5 file. It contains the id and the size of the canvas. Using this id we can obtain the context of the canvas. Specifing this context it creates, the colour of the canvas, style etc. The html5 page displays the canvas and the buttons when it loads.

Visit my github location to get the project code : http://github.com/abhilashak/project_graph_color

Visit my application at : http://colourthegraph.appspot.com/canvas/se11.html
Usually the term graph colouring algorithm indicates the vertex-colouring algorithm even though other algorithms are exists such as edge-colouring algorithm. The input of the graph colouring algorithm is the adjacentcy list of each node. It gives the nodes with the proper colour.

This Algorithm keeps a set of colours and the ‘availability list’ of colours for each node. First it takes each node in the order. It then checks the adjacentcy list of that node. If the first node in the list is coloured, it deletes that colour from the availability list. Then takes the next node from the adjacentcy list and the process continues. Last assigns the first colour in the availability list. This ensures the algorithm to take smallest number of colours.

Advertisement

Author: Abhilash

I'm Abhilash, a web developer who specializes in Ruby development. With years of experience working with various frameworks like Rails, Angular, Sinatra, Laravel, NodeJS, React and more, I am passionate about building robust and scalable web applications. Since 2010, I have been honing my skills and expertise in the Ruby on Rails platform. This blog is dedicated to sharing my knowledge and experience on topics related to Ruby, Ruby on Rails, and other subjects that I have worked with throughout my career. Join me on this journey to explore the exciting world of web development!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: