O documento descreve algoritmos para encontrar caminhos de menor custo em grafos, como o algoritmo de Dijkstra e o algoritmo de Bellman-Ford. O documento inclui exemplos passo a passo da aplicação dos algoritmos em um grafo exemplo e lista as etapas de implementação dos algoritmos em C++.
Texture Synthesis: An Approach Based on GPU UseMichel Alves
This theme has as main objective to provide a study of capacity of the fastest methods of procedural texture generation using the parallel architecture of current video cards and their respective graphical process- ing units. In this work, the focus of study will concentrate primarily for the generation of textures through the use of noise functions, but we will certainly consider other well known techniques. We outline recent advances in research on this topic, discussing and comparing recent and well-established methods.
Intelligent Transfer of Thematic Harmonic Color PalettesMichel Alves
This theme has as main objective to introduce a method of "smart" transfer of harmonic color palettes based on a particular theme or color expression model. The "smart" part would be shaped by the retention ca- pability information of the original input image, ie, the number of percep- tible colors must not be changed beyond be combined with other existing color model. The "thematic" part would be for the account of a research core of palettes that would read a certain base of images and would ex- tract the n best ranked palettes in the base.
A Framework for Harmonic Color MeasuresMichel Alves
This theme has as main objective to introduce a quality comparison scale for color images that takes into account the balance or harmony existing between set of colors of the input model/image. The main idea is to measure the "harmonic distance" of the input model in relation to a particular scheme but not perform the harmonization proccess.
Effectiveness of Image Quality Assessment IndexesMichel Alves
The main objective of this theme is to provide a study of effectiveness of the main image quality indexes in relation to the detection of distor- tions introduced after processes of acquisition, compression, filtering or sampling, as well as introducing a range of "admissibility" of distortions and degradation classes (like classes of noise, classes of blocking, classes of compression, classes of fusion/blending, classes of watermarking, etc.).
In non-parametric statistics, a kernel is a weighting function used in non-parametric estimation techniques. A kernel is a non-negative real-valued symmetric and integrable function K. Several types of kernel functions are commonly used: uniform, triangle, Epanechnikov, quartic (biweight), tricube, triweight, Gaussian, quadratic and cosine. In this presentation we will talk about the properties and applications of kernel functions.
About Perception and Hue Histograms in HSV SpaceMichel Alves
About Perception and Hue Histograms in HSV Space. In this presentation we will talk about the perception of colors and the measurement of this perception through the employment of hue histograms. In addition, we will show a brief comparison between the techniques of construction of hue histogram finishing with a histogram that employs a method called 'spatial color coherence'.
In this presentation we present some results using a technique developed by Daniel Cohen-Or (Color Harmonization, Cohen-Or et al., 2006) for matching colors in digital images, which has as base the templates or harmonic groupings developed in the works of Masataka Tokumaru (Color Design Support System Considering Color Harmony, 2002) and Yutaka Matsuda (Matsuda's Color Coordination, 1995).
Wave Simulation Using Perlin Noise. In this short demo we use the technique called fractal noise generation 'Perlin Noise' for obtaining an effect of waves in a tank with water. Perlin noise is a computer-generated visual effect developed by Ken Perlin, who won an Academy Award for Technical Achievement for inventing it. It can be used to simulate elements from nature, and is especially useful in circumstances where computer memory is limited. Essentially, perlin noise is a procedural texture primitive, a type of gradient noise used by visual effects artists to increase the appearance of realism in computer graphics. The function has a pseudo-random appearance, yet all of its visual details are the same size. Perlin noise is most commonly implemented as a two-, three- or four-dimensional function, but can be defined for any number of dimensions. In this short demo we use the technique called fractal noise generation 'Perlin Noise' for obtaining an effect of waves in a tank with water.
TMS - Schedule of Presentations and ReportsMichel Alves
Ten Minute Speech - Schedule of Presentations and Reports. Subjects: dissertation themes, results using capacity-constrained distribution, image-based reconstruction with color consistency, seamless montage and stats from slideshare!
[My Gallery of Graphs] Mastering the art of building classic and stylish graphics in R: Color Palettes in R. This document constains some examples of color palettes that can be used in R graphs.
Capacity-Constrained Point Distributions :: Video SlidesMichel Alves
In this presentation, we will show the slides used for the construction of video where we display some results obtained with the technique called 'Capacity-Constrained Point Distribution'.
Capacity-Constrained Point Distributions :: Density Function CatalogMichel Alves
In this presentation, we will show a catalog of density functions used in our work. We applied four kinds of density functions: constant, non-constant, image as boundary, and image as density function.
Sequência Didática - Cordel para Ensino Fundamental ILetras Mágicas
Sequência didática para trabalhar o gênero literário CORDEL, a sugestão traz o trabalho com verbos, mas pode ser adequado com base a sua realidade, retirar dos textos palavras que iniciam com R ou pintar as palavras dissílabas ...
Slides Lição 9, Central Gospel, As Bodas Do Cordeiro, 1Tr24.pptxLuizHenriquedeAlmeid6
Slideshare Lição 9, Central Gospel, As Bodas Do Cordeiro, 1Tr24, Pr Henrique, EBD NA TV, Revista ano 11, nº 1, Revista Estudo Bíblico Jovens E Adultos, Central Gospel, 2º Trimestre de 2024, Professor, Tema, Os Grandes Temas Do Fim, Comentarista, Pr. Joá Caitano, estudantes, professores, Ervália, MG, Imperatriz, MA, Cajamar, SP, estudos bíblicos, gospel, DEUS, ESPÍRITO SANTO, JESUS CRISTO, Com. Extra Pr. Luiz Henrique, 99-99152-0454, Canal YouTube, Henriquelhas, @PrHenrique
DeClara n.º 76 MAIO 2024, o jornal digital do Agrupamento de Escolas Clara de...
Graph Theory - Exercises - Chapter 3 - Algorithms of Dijkstra and Bellman-Ford
1. Teoria dos Grafos - Exerc´ıcios do Cap´ıtulo 3
Algoritmo de Dijkstra e Bellmann-Ford
Michel Alves dos Santos ∗
Abril de 2011
∗Bacharelando em Ciˆencia da Computa¸c˜ao, Universidade Federal do Estado de Alagoas(UFAL). E-mails: mi-
chel.mas@gmail.com, michelalavessantos@hotmail.com. Disciplina: Teoria dos Grafos. Docente Respons´avel: Leo-
nardo Viana Pereira.
1
2. Conte´udo
Lista de Figuras 2
Lista de Tabelas 2
1 Algoritmo de Dijkstra. 3
2 Algoritmo de Bellmann-Ford. 4
3 Algoritmos de Dijkstra e Bellmann-Ford. 4
4 Sa´ıda Produzida Pela Aplica¸c˜ao. 4
Lista de Figuras
1 Grafo utilizado para averiguar a efetividade da implementa¸c˜ao do Algoritmo de
Dijkstra. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Arborescˆencia de distˆancias obtida atrav´es da aplica¸c˜ao do Algoritmo de Dijkstra.
Esta arborescˆencia pode ser constru´ıda com base nos valores armazenados na tabela
de distˆancias. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 Grafo utilizado para averiguar a efetividade da implementa¸c˜ao do Algoritmo de
Bellmann-Ford. Ao final do processo obtivemos a mesma arborescˆencia de distˆancias. 4
Lista de Tabelas
1 Constru¸c˜ao da tabela de distˆancias entre v´ertices. . . . . . . . . . . . . . . . . . . . 3
2 Depois da avalia¸c˜ao de todos os v´ertices finalizamos a constru¸c˜ao da tabela com
todas as distˆancias a partir da origem. Com base nesta tabela tamb´em podemos
construir a arborescˆencia de distˆancias. . . . . . . . . . . . . . . . . . . . . . . . . . 4
2
3. 1 Algoritmo de Dijkstra.
Para verifica¸c˜ao dos resultados utilizando o algoritmo de Dijkstra, usamos primeiramente o
grafo observado abaixo. Informalmente, sem nenhuma criteriosidade ou formalidade matem´atica
Figura 1: Grafo utilizado para averiguar a efetividade da implementa¸c˜ao do Algoritmo de Dijkstra.
podemos descrever o Algoritmo de Dijkstra da seguinte maneira: procuramos o v´ertice mais pr´o-
ximo de A, depois, sucessivamente, procuramos entre os v´ertices n˜ao visitados aquele que tem a
menor distˆancia desde A, diretamente ou passando por algum v´ertice j´a visitado, anotando sem-
pre o percurso escolhido. Estamos considerando que nunca teremos distˆancias negativas, pois isso
atrapalharia o algoritmo, j´a que o mesmo n˜ao sabe lidar com distˆancias negativas(ele pode entrar
em looping). Come¸camos por construir uma tabela de distˆancias entre os v´ertices. Para os v´ertices
n˜ao ligados consideraremos a distˆancia como infinita. Para efeitos de implementa¸c˜ao a distˆancia
A B C D
A 0 12 2 ∞
B ∞ 0 ∞ ∞
C ∞ 5 0 2
D ∞ 1 ∞ 0
Tabela 1: Constru¸c˜ao da tabela de distˆancias entre v´ertices.
infinita foi representada pelo m´aximo n´umerico que poderia ser indexado pelo computador hospe-
deiro da aplica¸c˜ao/programa. Em C++ (linguagem utilizada para implementar o algoritmo) esse
m´aximo n´umerico ´e obtido atrav´es da biblioteca limits com o uso da classe numeric limits. Um
exemplo de uso dessas instru¸c˜oes ´e dado logo abaixo:
// Abaixo um exemplo de obten¸c~ao de limite n´umerico. Oten¸c~ao do maior inteiro
// com sinal que pode ser indexado, bem como o maior ponto flutuante de precis~ao
// dupla que pode ser representado na m´aquina hospedeira da aplica¸c~ao.
int maximo_int = numeric_limits<int>::max(); /*M´aximo inteiro*/
double maximo_dbl = numeric_limits<double>::max(); /*M´aximo ponto flutuante*/
Figura 2: Arborescˆencia de distˆancias obtida atrav´es da aplica¸c˜ao do Algoritmo de Dijkstra. Esta
arborescˆencia pode ser constru´ıda com base nos valores armazenados na tabela de distˆancias.
3
4. A B C D
Distˆancia 0 5 2 4
Anterior - D A C
Tabela 2: Depois da avalia¸c˜ao de todos os v´ertices finalizamos a constru¸c˜ao da tabela com todas as
distˆancias a partir da origem. Com base nesta tabela tamb´em podemos construir a arborescˆencia
de distˆancias.
2 Algoritmo de Bellmann-Ford.
Para verifica¸c˜ao dos resultados utilizando o algoritmo de Bellmann-Ford, usamos o mesmo
grafo com o qual averiguamos a capacidade do algoritmo de Dijkstra.
Figura 3: Grafo utilizado para averiguar a efetividade da implementa¸c˜ao do Algoritmo de
Bellmann-Ford. Ao final do processo obtivemos a mesma arborescˆencia de distˆancias.
Abaixo verificamos os passos utilizados para c´alculo das rotas a partir das informa¸c˜oes de
distˆancias entre os v´ertices.
(A, B) : dAB(∞) > dAA(0) + vAB(12) → dAB = 12 anterior(B) = A
(A, C) : dAC(∞) > dAA(0) + vAC(2) → dAC = 2 anterior(C) = A
(C, B) : dAB(12) > dAC(2) + vCB(5) → dAB = 7 anterior(B) = C
(C, D) : dAD(∞) > dAC(2) + vCD(2) → dAD = 4 anterior(D) = C
(D, B) : dAB(7) > dAD(4) + vDB(1) → dAB = 5 anterior(B) = D
Em uma segunda itera¸c˜ao n˜ao haver´a mudan¸cas nos valores das distˆancias c´alculadas atrav´es do
Algoritmo de Bellmann-Ford.
3 Algoritmos de Dijkstra e Bellmann-Ford.
Os algoritmos de Dijkstra e Bellmann-Ford foram implementados atrav´es da linguagem C++.
Os fontes com as respectivas classes e objetos de teste podem ser encontrados em anexo. As
funcionalidades das partes integrantes dos fontes podem ser facilmente entendidas, j´a que todas as
instru¸c˜oes foram exaustivamente documentadas. Para uma melhor compreens˜ao dos mecanismos
utilizados recomendamos a leitura dos livros Algorithms de Robert Sedgewick, The Algorithm
Design Manual de Steven S. Skiena, C++: The Complete Reference de Herbert Schildt, C++
by Dissection de Ira Pohl, The C++ Programming Language de Bjarne Stroustrup e finalmente
Effective C++ de Scott Meyers.
4 Sa´ıda Produzida Pela Aplica¸c˜ao.
A seguir ser´a exibida a sa´ıda produzida pela aplica¸c˜ao com base no exemplo dado anteriormente
(ver figura 1). Verifique a evolu¸c˜ao da tabela de distˆancias para a sa´ıda do algoritmo de Dijkstra
e o n´umero de itera¸c˜oes necess´arias, para que nesse exemplo, possamos chegar a um estado final.
4