Preview

Graphs In Data Structure

Good Essays
Open Document
Open Document
1178 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Graphs In Data Structure
Graphs - Introduction
Terminology
Graph ADT
Data Structures
Reading: 12.1-12.2
COSC 2011, Summer 2004

Definition
• A graph is a pair (V, E), where
– V is a set of nodes, called vertices
– E is a collection of pairs of vertices, called edges

• Both are objects (i.e. store data)
G

E

B

F
A
Vertex city computer web page airport C

D

COSC 2011, Summer 2004

H
Edge
road cable hyperlink flight Example Applications









Electronic circuits
– Printed circuit board
– Integrated circuit
Transportation networks
– Highway network
– Flight network
Computer networks
– Local area network
– Internet
– Web
Databases
– Entity-relationship diagram
Questions
– Are two points connected?
– What is the shortest path between them? cslab1a

cslab1b math.brown.edu cs.brown.edu

brown.edu qwest.net att.net

cox.net
John
Paul

COSC 2011, Summer 2004

David

Types of edges
• Undirected edge {u,v}
– Does not indicate direction
– We can “travel” in either direction

A

B

• Directed edge (u,v)
– Has a direction
A
– We can only “travel” in one direction along the edge

B

• Self-loop
– Edge that originates and ends at the same vertex

• Parallel edges

A

– Two undirected edges with same end vertices
– Two directed edges with same origin and destination
COSC 2011, Summer 2004

A

B

Types of graphs
• Undirected graph
– All edges are undirected

• Directed graph
– All edges are directed

• Mixed graph
– Has both directed and undirected edges

• Simple graph
– No parallel edges and self-loops
COSC 2011, Summer 2004

Example find route from C to G
G

E

B

F
A

C

D

H
G

E

B

F
A

C

D
COSC 2011, Summer 2004

H

Vertices and Edges







End vertices (or endpoints) of an edge
– U and V are the endpoints of a
Edges incident on a vertex - all edges that have the vertex as endpoint
– a, d, and b are incident on V
Adjacent vertices - endpoints of the same edge
– U and V are adjacent
Degree of a vertex - number of edges incident
V
h b a
– X has degree 5
Parallel edges
U
X

You May Also Find These Documents Helpful

  • Good Essays

    Between two nodes in a network there can be many connecting paths but usually shortest path is considered best. It means any information exchange between two nodes also go through all nodes appearing in shortest path. By this reason any node involved in shortest paths can have…

    • 596 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    In the figure below, CD bisects AB at D. For each of the following, find the value of ‘x’ and the measure of the segment indicated.…

    • 693 Words
    • 3 Pages
    Powerful Essays
  • Good Essays

    Nt1310 Final Exam

    • 1248 Words
    • 5 Pages

    b. The DNA separates into two single strands instead of remaining as a double helix.…

    • 1248 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    be much more secure than your standard medical facility. Where someone may be able to just…

    • 789 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    precedence diagram

    • 448 Words
    • 3 Pages

    The desired daily output for an assembly line is 360 units. This assembly line will operate 450 minutes per day. The following table contains information on this product’s task times and precedence relationships.…

    • 448 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Abstract - Graph layout has had important applications in many areas of computer science. When dealing with machine generated data, we often tend to see the data to have better understanding of a structural form. Many such data can be represented in the form of graphs. By laying out a graph, we can untangle information and intuitively show relations of objects. Automated graph drawing remains a difficult placement and layout problem. This problem is difficult in part due to the complexity of formulating good algorithms to draw graphs which are aesthetically pleasing for human visualization. In this paper, we have implemented a Force-Directed Placement algorithm using Python environment that will solve the graph layout problem by using an energy minimization technique. This work aims to demonstrate the performance advantage of a GPU implementation as compared to a CPU implementation. For CPU Python is the programming platform chosen and for GPU NVIDIA PyCUDA is the platform chosen. The GPU implementation was able to achieve up to a 55-60x speed-up as compared to the CPU.…

    • 2582 Words
    • 11 Pages
    Powerful Essays
  • Powerful Essays

    Assembling Charts

    • 711 Words
    • 3 Pages

    I got to watch Mrs. Cathy as she reviewed charts for deficiencies. If any deficiencies are noted a note is put on the chart and the chart is returned to the physician to have all documentation correct or signed.…

    • 711 Words
    • 3 Pages
    Powerful Essays
  • Good Essays

    Data Flow Diagram Tutorial

    • 3124 Words
    • 13 Pages

    Data flow diagrams can be used to provide a clear representation of any business function. The technique starts with an overall picture of the business and continues by analyzing each of the functional areas of interest. This analysis can be carried out to precisely the level of detail required. The technique exploits a method called top-down expansion to conduct the analysis in a targeted way.…

    • 3124 Words
    • 13 Pages
    Good Essays
  • Good Essays

    Entity-Relationship Diagrams

    • 8631 Words
    • 35 Pages

    Data models are tools used in analysis to describe the data requirements and assumptions in the system from a top-down perspective. They also set the stage for the design of databases later on in the SDLC.…

    • 8631 Words
    • 35 Pages
    Good Essays
  • Better Essays

    • Array elements can be directly accessed. With arrays if you know you want to access the ith element, you can simply use one line of code: arrayName[i].…

    • 3449 Words
    • 14 Pages
    Better Essays
  • Better Essays

    Data Representation

    • 1150 Words
    • 5 Pages

    Data and instructions that are presented in a written or typed format can only be understood by the user. If the data is not in the user’s language, s/he will not be able to understand it. It is the same way with the computer; the computer’s language is binary 0s and 1s. The computer cannot understand typed or written instructions or data. Whenever data or instructions or input to the computer it is first converted to 0s and 1s, these are called binary digits (bits). There are a number of methods that are used to represent data in computer system, namely:…

    • 1150 Words
    • 5 Pages
    Better Essays
  • Powerful Essays

    Macros are scripts that provide a way to automate a task performed repeatedly or on a regular basis. It involves a series of commands and actions that can be triggered by performing specific commands through the keyboard, mouse, program compilation, etc. Tasks performed by macros are commonly repetitive in nature. In effect, macros decrease the time it would take for users to do these repetitive actions in an application. These tasks can be as simple as inserting names and addresses into a word processor or as complex as launching a program, copying data from it, activating another program, pasting the data into it and repeating this several times.…

    • 3986 Words
    • 16 Pages
    Powerful Essays
  • Good Essays

    DATA FLOW DIAGRAM

    • 375 Words
    • 6 Pages

    DATA FLOW DIAGRAM Group#7 Nugao Oserin Obongen The Data Flow Diagram (DFD) • a graphical representation of the flow of data through an information system. It enables you to represent the processes in your information system from the viewpoint of data. The DFD lets you visualize how the system operates, what the system accomplishes and how it will be implemented, when it is refined with further specification.…

    • 375 Words
    • 6 Pages
    Good Essays
  • Powerful Essays

    1.1 INTRODUCTION Data structure is the branch of computer science that unleashes the knowledge of how the data should be organized, how the flow of data should be controlled and how a data structure should be designed and implemented to reduce the complexity and increase the efficiency of the algorithm. The theory of structures not only introduces the data structures, but also helps to understand and use the concept of abstraction, analyze problems step by step and develop algorithms to solve real world problems. Thus it enables various data structures like stacks, queue, linked list, trees and graphs. Effective use of principles of data structures increases efficiency of algorithms to solve problems like searching, sorting, populating and handling voluminous data. 1.2 Basic Terminology of Data Organization Data: The term data means a value or set of values. For example, marks of students, figures obtained during exit polls etc. The data is stored in the memory of computer. Different models are used to organize data in the memory. For example, the model used to organize the data in main memory are collectively referred to as data structures, whereas the different models used to organize data in the secondary memory are collectively referred to as file structures. Data item:- A data item means a single unit of values. For example, roll number, name, address etc. Entity: Entity is something that has certain qualities, characteristics, properties or attributes that may contain some values. For example, Student is an entity. The attributes of student may be roll number, name, address, etc, The values of these attributes may be 100, Ram, House No. 133-A, Pragati Vihar, Delhi. Entity Set: An entity set is a group of or set of similar entities. For example, employees of an organization, students of a class etc. Information: When the data is processed by applying certain rules, new processed data is called information. The data are not useful for decision…

    • 2894 Words
    • 12 Pages
    Powerful Essays
  • Powerful Essays

    Data structures

    • 7448 Words
    • 47 Pages

    Stacks – Basic Operations, Linked stack, Algorithms, Implementation, Applications – Infix to Postfix, Evaluation of Postfix - Queues – Operations, Linked list design, algorithms, Mazing Problem, Complex implementations – circularly linked lists, doubly linked lists – Sparse Matrices – linked representation, input, output, erase…

    • 7448 Words
    • 47 Pages
    Powerful Essays

Related Topics