Avila coworking avila cowork-lisboa-novos desafios, novas oportunidades
UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO...
Transcript of UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO...
![Page 1: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/1.jpg)
UNIVERSIDADE CATÓLICA DE PELOTASESCOLA DE INFORMÁTICA
MESTRADO EM CIÊNCIA DA COMPUTAÇÃO
Disciplina:Estruturas de Dados
Aluno:Christiano Otero Avila
Prof. Dr. Paulo Roberto Gomes Luzzardi
![Page 2: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/2.jpg)
ÁRVORES DE EXPANSÃO MÍNIMA
![Page 3: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/3.jpg)
SumárioSumário
Introdução
Termo em Inglês e Sinônimos
Aplicações
Conceito
Construção passo-a-passo
Algoritmos
Exercícios
Animações
Bibliografia
![Page 4: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/4.jpg)
IntroduçãoIntrodução
![Page 5: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/5.jpg)
Termo em Inglês e SinônimosTermo em Inglês e Sinônimos
Termo em inglês:• Minimum Spanning Tree (MST)
Alguns sinônimos encontrados:• Árvores de Expansão Mínima• Árvores Geradora Mínima• Árvores de Cobertura Mínima• Árvores Espalhadas Mínimas
![Page 6: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/6.jpg)
AplicaçõesAplicações
Projetos de redes de telecomunicações:•Redes de computadores•Redes de fibra ótica•Redes de telefonia•Redes de televisão a cabo
Projetos na área de transportes:•Rodovias, ferrovias, gasoduto (ops....)•Irrigação – “transporte de água”•Logística (distribuição)
Projetos de redes de distr. de energia
Mineração de dados em clustering
![Page 7: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/7.jpg)
AplicaçõesAplicações
Sistemas de Informações Geográficas:
![Page 8: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/8.jpg)
ConceitoConceito
Árvore que interliga todos os vértices do grafo utilizando arestas com um custo total mínimo
![Page 9: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/9.jpg)
ConceitoConceito
Dado um grafo não dirigido ponderado G, desejamos encontrar uma árvore T que contenha todos os vértices de G e minimize sua soma.
![Page 10: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/10.jpg)
Construção passo-a-passoConstrução passo-a-passo
![Page 11: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/11.jpg)
ConceitoConceito
![Page 12: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/12.jpg)
Construção passo-a-passoConstrução passo-a-passo
![Page 13: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/13.jpg)
Construção passo-a-passoConstrução passo-a-passo
![Page 14: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/14.jpg)
Construção passo-a-passoConstrução passo-a-passo
![Page 15: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/15.jpg)
Construção passo-a-passoConstrução passo-a-passo
![Page 16: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/16.jpg)
Construção passo-a-passoConstrução passo-a-passo
![Page 17: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/17.jpg)
AlgoritmosAlgoritmos
- Algoritmo de Prim - Algoritmo de Kruskal- Algoritmo de Boruvka
![Page 18: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/18.jpg)
Algoritmos - PrimAlgoritmos - Prim
O célebre algoritmo de Prim resolve o problema da árvore geradora de peso mínimo num grafo simétrico com função-peso simétrica. O algoritmo foi inventado por R.C. Prim (Bell Systems Techncal Journal, 1957). No início de cada iteração temos dois tipos de vértices, os pretos e os brancos, e uma árvore com raiz r que "cobre" o conjunto dos vértices pretos. O algoritmo tem um caráter guloso: cada iteração acrescenta à árvore o arco mais leve dentre os que ligam um vértice preto a um vértice branco.
![Page 19: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/19.jpg)
Algoritmos - PrimAlgoritmos - Prim
A implementação a seguir supõe que os vértices do grafo são 1, 2, … . , n e devolve um vetor de predecessores pai que representa uma r-árvore geradora de peso mínimo. O algoritmo usa uma "fila" de arcos que contém todos os arcos com ponta inicial preta e ponta final branca. Os detalhes de implementação da fila ficam por conta da imaginação do leitor, mas tudo se passa como se os arcos estivessem na fila sempre em ordem crescente de f. Cada arco é representado como um par ordenado de vértices.
![Page 20: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/20.jpg)
Algoritmos - PrimAlgoritmos - Prim
Animação:http://www-b2.is.tokushima-u.ac.jp/~ikeda/suuri/dijkstra/PrimApp.shtml?demo6
![Page 21: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/21.jpg)
Algoritmos - KruskalAlgoritmos - Kruskal
Animação:http://www-b2.is.tokushima-u.ac.jp/~ikeda/suuri/kruskal/KruskalApp.shtml?demo4
![Page 22: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/22.jpg)
AlgoritmosAlgoritmos
Algoritmo de Boruvka • Também conhecido como Baruvka• A idéia geral desse algoritmo consiste em começar por ligar cada vértice ao seu vizinho mais próximo, criando, no máximo, V/2 árvores. Depois, ligar cada árvore à outra árvore que lhe estiver mais próxima, até que todos os vértices do grafo estejam inseridos na árvore.
![Page 23: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/23.jpg)
Algoritmos - BoruvkaAlgoritmos - Boruvka
• O algoritmo de Boruvka compreende os seguintes passos:1. Para cada vértice escolher o seu arco com peso mínimo. Deste passo poderão resultar vários subgrafos.2. Caso o passo 1 dê origem a grafos não conectados, considere cada subgrafo gerado no passo anterior como um vértice do grafo final. Para cada um dos subgrafos gerados execute-se de novo o passo 1.3. Parar quando todos os vértices estiverem conectados entre si formando assim a AGM/MST.
![Page 24: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/24.jpg)
Algoritmos - BoruvkaAlgoritmos - Boruvka
![Page 25: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/25.jpg)
Algoritmos - BoruvkaAlgoritmos - Boruvka
![Page 26: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/26.jpg)
Exercícios Exercícios
• Pretende-se construir novas estradas de modo que 5 cidades (A,B,C,E e E) fiquem ligadas. Os custos de construção das estradas são os indicados na tabela. Informe o valor da árvore geradora mínima.
![Page 27: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/27.jpg)
Exercícios Exercícios
• Dica – construir o grafo
![Page 28: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/28.jpg)
Animações Animações
http://www-b2.is.tokushima-u.ac.jp/~ikeda/suuri/dijkstra/Prim.shtml
http://students.ceid.upatras.gr/~papagel/project/prim.htm
http://www.cs.man.ac.uk/~graham/cs2022/greedy/index.html
![Page 29: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/29.jpg)
Bibliografia Bibliografia
• Goodrich, Michael T; Projeto de Algoritmos: Fundamentos análise e exemplos da Internet; Bookman, 2004.• Sampaio, Rudini; Yanasse, Horácio; Estudo e Implementação de Algoritmos de Roteamento sobre Grafos em um Sistema de Informações Geográficas;UFLA,INPE.• Cormen, T. H.; Leiserson, C. E.; Rivest, R. L. Introduction to Algoritms; MIT Press, 1999.
![Page 30: UNIVERSIDADE CATÓLICA DE PELOTAS ESCOLA DE INFORMÁTICA MESTRADO EM CIÊNCIA DA COMPUTAÇÃO Disciplina:Estruturas de Dados Aluno:Christiano Otero Avila Prof.](https://reader035.fdocumentos.com/reader035/viewer/2022070311/552fc14c497959413d8e278d/html5/thumbnails/30.jpg)
UNIVERSIDADE CATÓLICA DE PELOTASESCOLA DE INFORMÁTICA
MESTRADO EM CIÊNCIA DA COMPUTAÇÃO
Disciplina:Estruturas de Dados
Aluno:Christiano Otero Avila
Prof. Dr. Paulo Roberto Gomes Luzzardi