16
Submitted By: Under the Guidance of: Lecturer ,dept of CSE. Lecturer , dept of CSE.

Computer graphics mini project on bellman-ford algorithm

Embed Size (px)

DESCRIPTION

This is PPT of Computer graphics mini project on bellman-ford algorithm. The 6th sem Opengl Projects for VTU. The projects demo about the Bellman-Ford algorithm, how it works using the OpenGL graphics library in MS Visual Studio. You can get free source code for this mini projects from - http://www.openglprojects.in/2012/06/mini-project-on-bellman-ford-algorithm.html

Citation preview

Page 1: Computer graphics mini project on bellman-ford algorithm

Submitted By:

Under the Guidance of:

Lecturer ,dept of CSE.

Lecturer , dept of CSE.

Page 2: Computer graphics mini project on bellman-ford algorithm

CONTENTS

1. Abstract.2. Introduction.3. Introduction to CG. 4. Introduction to OPENGL.4 Specific to the Problem.5. Design and Implementation .6.Results and Snapshot.7. Conclusion and Future Scope.8. Reference.

Page 3: Computer graphics mini project on bellman-ford algorithm

ABSTRACT

Objective of the project is to implement the

“Bellman-ford Algorithm” In this project six Nodes are created with 5

sources and one destination Node. The packet it let to flow thought the shortest path as calculated by the

User is allowed to choose the source node and then packet movement is shown.

Page 4: Computer graphics mini project on bellman-ford algorithm

INTRODUCTION

Aim:-

The aim of the project is to Bellman-ford Algorithm using Opengl functions.

In this project we mainly concentrate on creation of Nodes and conncetion between them with Lines and Showing the packet movement by GL_QARD in Loop with covering color with the black.

Page 5: Computer graphics mini project on bellman-ford algorithm

INTRODUCTION ABOUT CG

Computer Graphics is concerned with all aspects of producing pictures or images using a computer. Nowadays we can create images by computer that are indistinguishable from photographs of real objects.

Page 6: Computer graphics mini project on bellman-ford algorithm

INTRODUCTION ABOUT OPENGL

OpenGL (Open Graphics Library) is a graphics software system, which has become a widely accepted standard for developing graphics applications.

OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics.

Page 7: Computer graphics mini project on bellman-ford algorithm

  SPECIFIC TO THE PROBLEM

Significant of the Project The Bellman-Ford algorithm also known as Ford-Fulkerson

algorithm is based on the principle that is intuitively easy to understand. Each node A knows the shortest path to node Z, then node A can determine its shortest path to Z by calculating the minimum cost.

Each node connected to another node with a cost, now when the packet flows through a path it result some cost to the network . To minimize the cost of network communication Bellman-Ford algorithm is implemented and the packet flow to the path which costs less in the communication.

Page 8: Computer graphics mini project on bellman-ford algorithm

WORKING PRINCIPLE

First we draw the nodes and connecting lines by passing co-ordinate values to a GL_LINES .It will draw the network and connections of the network. The shortest path is calculated by using Bellman-Ford algorithm using the following formula-

1.Initialization Di=∞; for all i≠ d (3.1)

Dd=0 (3.2)

2.Updation Di=minj{Cij+Dj} (3.3)

Repeat step 2 until no more change occur in iteration.   To draw the packet we pass the co-ordinate values to the GL_QUAD. Now to move the

packet from one node to another node we draw the packet at different points of co-ordinate using for loop. The loop will make the polygon in the certain color specified from the starting co-ordinate to the end with the incremented value. Now we cover the part of the long polygon which is generated in the loop using the same co-ordinate values and loop coloring with black. The black color cover the previous color and this makes the sense for the movement of the packet. Similar thing is done for all the packet movement.

Page 9: Computer graphics mini project on bellman-ford algorithm

DESIGN AND IMPLEMENTATION

The project used GL_LINES function to make the network. The project contains 6 nodes which are joined through the lines. Packet is drawn through the use of for loop and specifying co-ordinates with GL_QUAD in the loop. The black color covers the original color which makes the movement possible.

The cost of the path and the node number is implemented using setFont() and drawstring() functions. title()- To draw front page. text()- Creates the text for the option menu. draw()- To draw the polygons for the menu box. delay()- It makes delay between display. delaypacket()- Delays the packet flow. naming()- It assigns node number and cost of the path. shape()- For drawing the nodes. move()- For movement of the packets. title()- For displaying the front page. mykeyboard()- Allows the user to repeat the demonstration. myMouse()- Allows the user to choose the options. display()- This will call draw and other functions to display. node1() to node5()- The functions shows movement packet of the particular node as source.

Page 10: Computer graphics mini project on bellman-ford algorithm

SNAPSHOTS

Page 11: Computer graphics mini project on bellman-ford algorithm
Page 12: Computer graphics mini project on bellman-ford algorithm
Page 13: Computer graphics mini project on bellman-ford algorithm

CONCLUSION

The project has been successfully completed but further it could have been enhanced I learnt a lot of new things while doing the project, which can prove very useful in the software field.

By user’s point of view, the openGL software is very easy to use.

Also it is the most widely used application in interaction.

Page 14: Computer graphics mini project on bellman-ford algorithm

Future scope

It is the basic Implemetation of Bellman-Ford Algorithm

In future this program can be improved by using of new opengl functions. With more user interactions and 3D views.

Page 15: Computer graphics mini project on bellman-ford algorithm

Reference Interactive computer graphics, Edward Angel. OpenGL Programming Guide by Bill Glazier, Kipp Hickman,

Phil Karlton, Mark Segal, Kevin P. Smith, and Wei Yen. The Red Book OpenGL programming Guide by, Addison-

Wesley Publishing Company. The OpenGL Graphics System: A Specification Version 3.0

by,Mark Segal & Kurt Akeley. Using OpenGL in Visual C++ by,Alan Oursland. http://graphics.stanford.edu/. http://www.opengl.org/documentation/books.

15

Page 16: Computer graphics mini project on bellman-ford algorithm

THANK YOU