Professional Documents
Culture Documents
BELAGAVI-590014, KARNATAKA
“PRIM’S ALGORITHM”
Submitted in Partial Fulfillment of the Requirement for
“Computer Graphics Laboratory with Mini Project-VI Semester”
BACHELOR OF ENGINEERING
IN
MEGHANA G (1SG18CS054)
Certificate
This is to certify that the Mini Project Work entitled “PRIM’S ALGORITHM” carried
out by FOUZIA ANJUM. S (1SG18CS030) & MEGHANA G (1SG18CS054), bonafide
students of Sapthagiri College of Engineering, in partial fulfillment for the award of
Bachelor of Engineering degree in Computer Science and Engineering of
Visvesvaraya Technological University, Belagavi during the academic year 2020-21. It
is certified that all corrections/suggestions indicated for Internal Assessment have been
incorporated in the report deposited in the department library. The mini-project report has
been approved as it satisfies the academic requirements in respect of Computer Graphics
Laboratory with Mini Project (18CSL67) prescribed for the said Degree.
EXTERNAL EXAMINATION
1. _____________________ _____________________
2. _____________________ _____________________
ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the completion of any task would be
incomplete without the mention of the people who made it possible, whose constant guidance
and encouragement ground my efforts with success.
I consider it is a privilege to express my gratitude and respect to all those who guided me in
completion of technical seminar.
I am, grateful to thank our Principal Dr. H Ramakrishna, Sapthagiri College of Engineering,
who patronized throughout my career and for the facilities provided to carry out this work
successfully.
It’s a great privilege to place on record my deep sense of gratitude to our beloved HOD Dr.
Kamalakshi Naganna of Computer Science and Engineering, who patronized throughout my
career and for the facilities provided to carry out this work successfully.
I am also grateful to thank our mini project Guides Prof. Chaithra , Associate Professor and
Mrs. Manasa K N, Assistant Professor of CSE department for her invaluable support and
guidance.
I would also like to thank the teaching and non-teaching staff members who have helped me
directly or indirectly during the technical seminar.
Lastly but most importantly I would like thank my family and friends for their co- operation
and motivation to complete this seminar successfully.
MEGHANA G (1SG18CS054)
ABSTRACT
This project demonstrates a simple illustration of Prim’s Algorithm. Here the arrays of
elements are represented in the form of circles with different radii. Minimum Spanning Tree
is generated with the help of given costs.
Here we use the keyboard as an input device. Keyboard events are generated when the mouse
is in the window and one of the keys is pressed or released.
The GLUT function glutKeyboardFunc is the callback for events generated by pressing the
key. When it occurs the ASCII code for the key that generated the event and the location of
the mouse are returned.
All the keyboard callbacks are registered in a single callback function, such as the following:
glutKeyboardFunc(keyboard);
2 Requirement Specification 10
2.2.1. Dependability
2.2.2. Availability
2.2.3. Reliability
2.2.4. Safety
2.2.5. Security
3 Design 13
4 Implementation 14
5 Testing 18
6 Snapshots 19
7 Conclusion 22
23
Bibliography
LIST OF FIGURES
SL. No. Figure No. Title Of Figure Page No.
CHAPTER 1
INTRODUCTION
The Computer Graphics is one of the most effective and commonly used methods to
communicate the processed information to the user. It displays the information in the form of
graphics objects such as pictures, charts, graphs and diagram instead of simple text.
In computer graphics, pictures or graphics objects are presented as a collection of discrete
picture elements called pixels. The pixel is the smallest addressable screen element.
Computer graphics today is largely interactive: The user controls the contents structure, and
appearance of objects and their displayed images by using input devices, such as a keyboard,
mouse, or touch-sensitive panel on the screen.
The image enhancement deals with the improvement in the image quality by eliminating
noise or by increasing image contrast. Pattern detection and recognition deals with the
detection and clarification of standard patterns and finding deviations from these
patterns .The optical character recognition (OCR) technology is an practical example for
pattern detection & recognition. Scene analysis deals with the recognition and reconstruction
of 3D model of scene from several 2D images.
1. Display of information.
2. Design.
3. Simulation and Animation.
4. User interfaces.
1.1 Overview of the project
Implementing certain technical concepts like transformation. To show that implementation of
bubble sort and selection sort graphically. Migration from text editor to OpenGL. Consists of
array of elements represented in the form of circles in random order. Sorting the randomized
elements.
Displaying the elements that are being swapped.
Blending:
The project uses blending to make objects appear transparent.
Transformations:
A transformation is a function that takes a point or vector and maps that point or vector into
another point or vector. In this application the transformation is used to make the plane to
rotate in all 3 axis.
Bitmap Character:
OpenGL supports two kinds of texts: bitmap character and stroke character. Bitmap
characters are basically 2D font without thickness. In this application bitmap character is used
to display the texts.
1. Initialize a tree with a single vertex, chosen arbitrarily from the graph.
2. Grow the tree by one edge: of the edges that connect the tree to vertices not yet in the
tree, find the minimum-weight edge, and transfer it to the tree.
3. Repeat step 2 (until all vertices are in the tree).
The project has been implemented in modules so as to make it user friendly i.e. if a code
viewer is finding trouble with a particular function it can go to a particular module and make
corresponding changes in it instead of searching in the program. Also it is more advantageous
for future modifications as when modifications are to be made instead of searching the whole
program module search can be useful as it decreases the time consumption.
CHAPTER 2
REQUIREMENT SPECIFICATION
A software requirement definition is an abstract description of the services which the system
should provide, and the constraints under which the system must operate. It should only
specify the external behaviour of the system.
2.2Non-functional requirements:
These are constraints on the services or functions offered by the system. They include timing
constraints, constraints on the development process and standards. Non-functional
requirements often apply to the system as a whole.
Non-Functional Requirements are as follows:
2.2.1 Dependability:
The dependability of a computer system is a property of the system that equates to its
trustworthiness. Trustworthiness essentially means the degree of user confidence that the
system will operate as they expect and that the system will not ‘fail’ in normal use.
2.2.2 Availability:
The ability of the system to deliver services when requested. There is no error in the program
while executing the program.
2.2.3 Reliability:
The ability of the system to deliver services as specified. The program is compatible with all
types of operating system without any failure.
2.2.4 Safety:
The ability of the system to operate without catastrophic failure. This program is user friendly
and it will never effects the system.
2.5.2 Security:
The ability of the system to protect itself against accidental or deliberate intrusion.
Data flow design is as shown below covering the flow of the data in the system. It describes
the relation between user input and the system behaviour.
START
Main
Click
Enter
No
1.Create Nodes
List of Menus 2.Draw Edges
3.Draw
Spanning Tree
Yes
STOP
Figure 1.2
CHAPTER 4:
IMPLEMENTATION
To implement the Current System, we have used different functions of our project which are
as follows:
window position and size respectively.
13. glutCreateWindow:-creates a top-level window.
menu.
17. glutMainLoop:- enters the GLUT event processing loop.
Figure 2.1
Figure 2.3
Figure 2.5
CHAPTER 7:
CONCLUSION
The presence of many built-in functions take care of much functionality and reduce the job of
coding as well as make the implementation simpler. We have implemented the project
making it user friendly and error free as much as possible.
The development of the project is not an easy process as it involves lot of challenges in
different stages of software analysis, design, coding and testing.
Having understood the requirements properly and implementing the solutions as per the
expectation as brought to the closure of the project.
We have tried our best to make this project very realistic, so that the user does not face any
trouble when switching over from any real life graphics project to this highly useful one.
In this project the graphics used makes any user fascinating to look into the output sreen.In
future this program can be improved by using more advanced OpenGL functions.
BIBILOGRAPHY
Reference Books:
Websites:
1. www.opengl.org
2. www.google.co.in(OpenGLprojects)
3. www.wikipedia.com
4. www.youtube.com
5. www.github.com