Graph Theory in Computer Science Daniel Candeias 2012/2013.

22
Graph Theory in Computer Science Daniel Candeias 2012/2013

Transcript of Graph Theory in Computer Science Daniel Candeias 2012/2013.

Page 1: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Graph Theory in Computer Science

Daniel Candeias2012/2013

Page 2: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Contents

• Introduction• What is graph theory? • Fields of study• Applications in computer Science• Graph Operations

• Common Problems

Page 3: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Introduction

• With this presentation I want to show you that we can use Graph Theory in diverse fields of study.

• I’ll focus in Computer Science applications, and give you a general overview about it.

Page 4: Graph Theory in Computer Science Daniel Candeias 2012/2013.

What is Graph Theory?

Definition: The mathematical theory of the properties and applications of graphs.

Used to understand and solve many of mathematical and path problems.

Page 5: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Fields of Study

The cells of a GSM mobile phone network

Mathematical problem

Music

Other examples:

• Electrical eng.• Biochemistry• Computer science• Physics

Page 6: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Applications in computer Science (1)

• Since computer science is not a concrete/centralized subject, we can introduce graph theory in many areas.

But where

Let’s see some examples…

Page 7: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Applications in computer Science (2)

Networks: Graph theory can be used in computer networks, for security purpose or to schematize network topologies, for example.

Page 8: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Applications in computer Science (3)

Webpage: can be represented by a direct graph. The vertices are the web pages available at the website and a directed edge from page A to page B exists if and only if A contains a link to B.

Facebook is based in graph theory

Page 9: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Applications in computer Science (4)

Workflow: It’s sequence of processes through which a piece of work passes from initiation to completion. Can be also represented as directed graph.

Page 10: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Applications in computer Science (5)

Neural Networks: A series of algorithms that attempt to identify underlying relationships in a set of data by using a process that mimics the way the human brain operates.

Page 11: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Applications in computer Science (6)

Google Maps:

Page 12: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Graph Operations (1)

Basic Operations

Page 13: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Graph Operations (2)

Shortest Path: is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized. E.g. Dijkstra’s algorithm

Page 14: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Graph Operations (3)

Minimun Spanning tree: A tree is a connected graph without cycles with some properties:

• A graph is a tree if and only if there is one and only one path joining any two of its vertices.

• A connected graph is a tree if and only if every one of its edges is a bridge.

• A connected graph is a tree if and only if it has N vertices and N; 1 edges.

E.g. Kruskal's Algorithm

Page 15: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Graph Operations (4)

Minimun Spanning tree

Page 16: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Graph Operations (5)

Breadth-First Search (BFS): algorithm used to search in graphs.

Page 17: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Graph Operations (6)

Depth-First Search (DFS): algorithm used to search in graphs.

Page 18: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Graph Operations (7)

DFS Vs. BFS

Page 19: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Common problems (1)

House of Santa Claus: the house in the picture can be represented as a graph, where each vertice is a node. Try to draw a the house by yourself fallowing this rules: • You have to draw a house in one line. • You must not lift your pencil while drawing.• You must not repeat a line.

Page 20: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Common problems (2)

Three Houses, Three Utilities: there are three utilities (three vertices) and three houses (three vertices), and the purpose of this problem is to draw a line from each house to each facility without the lines ever crossing.

Page 21: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Conclusions

• As we can see Graph Theory can be applied to several areas.

• In Computer Science is mainly used to solve problems, or to represent scenarios, related with networks.

Page 22: Graph Theory in Computer Science Daniel Candeias 2012/2013.

Thank you!

Daniel Candeias