The document discusses representing and visiting graphs. It describes different methods for representing graphs, such as adjacency lists and matrices. It also covers the JGraphT library for working with graphs in Java. Finally, it explains algorithms for visiting graphs, including breadth-first search and depth-first search.
We will discuss the following: Graph, Directed vs Undirected Graph, Acyclic vs Cyclic Graph, Backedge, Search vs Traversal, Breadth First Traversal, Depth First Traversal, Detect Cycle in a Directed Graph.
We will discuss the following: Graph, Directed vs Undirected Graph, Acyclic vs Cyclic Graph, Backedge, Search vs Traversal, Breadth First Traversal, Depth First Traversal, Detect Cycle in a Directed Graph.
1. Problema e soluzione
2. I Learning Object
3. Metadati
4. SCORM
Lezione presso il corso di Master in E-Learning per la Pubblica Amministrazione.
Si tratta di un Corso Universitario di Aggiornamento Professionale, finanziato da INPS/INPDAP e progettato in collaborazione con la Città di Torino e la Provincia di Torino, erogato tra maggio 2014 e settembre 2014.
Per maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/247-master-elpa
Componenti dello stack LAMP - PHP, il linguaggio, l'installazione - MySQL, in...Fulvio Corno
Master: Amministratore Linux - Livello Avanzato
Nel contesto della formazione professionale rivolta ad aziende ed enti pubblici, sono stati preparati ed erogati dei corsi di Amministratore di sistemi Linux, al livello base ed al livello avanzato.
Il contenuto del corso è allineato con alcuni moduli della certificazione LPIC (Linux Professional Institute Certification), a cavallo tra i livelli 1 e 2. Tutto il materiale didattico è disponibile liberamente con licenza Creative Commons BY-NC-SA.
I docenti del corso sono i proff. Giovanni Squillero, Bartolomeo Montrucchio e Fulvio Corno.
Maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/255-master-linux-admin
Edifici intelligenti: innovazione tecnologica e convergenza degli impiantiFulvio Corno
Presentazione presso il seminario "IMPIANTI D’ANTENNA: PRESENTE E FUTURO" organizzato dalla Camera di Commercio di Torino il 18/06/2012. http://www.to.camcom.it/Page/t23/view_html?idp=14632
L'intervento illustra il punto di vista della convergenza tecnologica tra i diversi tipi di impanti presenti in una moderna casa intelligente, con particolare attenzione all'interoperabilità. alla standardizzazione ed alla progettazione integrata.
Introduzione alla disabilità.
1. La disabilità: definizione, numeri e domande
2. Tecnologia e approccio alla disabilità
3. La classificazione della disabilità
4. ICF: Classificazione Internazionale del Funzionamento,
della Disabilità e della Salute.
Materiale relativo al corso di Tecnologie per la Disabilità del Politecnico di Torino (http://bit.ly/tecndisab), Anno Accademico 2011/2012
Intelligenza ambientale applicata alla casaFulvio Corno
Seminario tenuto presso la Maison Equipée (Saint Marcel, Aosta, Italia) sul tema della domotica e dell'intelligenza ambientale applicati alla casa intelligente ed al supporto di utenti anziani e disabili.
Lezione presso il corso di Master in E-Learning per la Pubblica Amministrazione.
Si tratta di un Corso Universitario di Aggiornamento Professionale, finanziato da INPS/INPDAP e progettato in collaborazione con la Città di Torino e la Provincia di Torino, erogato tra maggio 2014 e settembre 2014.
Per maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/247-master-elpa
Intervento alla tavola rotonda "La gestione domiciliare del paziente SLA" del XII Workshop SLA (Sclerosi Laterale Amiotrofica) tenutosi a Napoli il 10/11/2012.
Nella presentazione si illustrano le potenzialità della domotica, come degli ausili tecnologici avanzati, per aumentare il grado di autonomia dei pazienti con seri problemi di mobilità, grazie ad una collaborazione tra le varie figure professionali e ad una progettazione incentrata sulla persona.
Attivare facilmente il Prompt dei comandi in Code::BlocksFulvio Corno
Breve tutorial per aggiungere una voce al menù "Tools" di Code::Blocks per aprire rapidamente una finestra "Prompt dei Comandi" già posizionata nella directory che contiene il file eseguibile.
La percezione sensoriale.
1. L’uomo elaboratore di informazione
2. Il meccanismo della percezione
3. L’udito
4. La vista
5. Gli altri sensi.
Materiale relativo al corso di Tecnologie per la Disabilità del Politecnico di Torino (http://bit.ly/tecndisab), Anno Accademico 2011/2012
Master: Amministratore Linux - Livello Base
Nel contesto della formazione professionale rivolta ad aziende ed enti pubblici, sono stati preparati ed erogati dei corsi di Amministratore di sistemi Linux, al livello base ed al livello avanzato.
Il contenuto del corso è allineato con alcuni moduli della certificazione LPIC (Linux Professional Institute Certification), a cavallo tra i livelli 1 e 2. Tutto il materiale didattico è disponibile liberamente con licenza Creative Commons BY-NC-SA.
I docenti del corso sono i proff. Giovanni Squillero, Bartolomeo Montrucchio e Fulvio Corno.
Maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/255-master-linux-admin
Master: Amministratore Linux - Livello Avanzato
Nel contesto della formazione professionale rivolta ad aziende ed enti pubblici, sono stati preparati ed erogati dei corsi di Amministratore di sistemi Linux, al livello base ed al livello avanzato.
Il contenuto del corso è allineato con alcuni moduli della certificazione LPIC (Linux Professional Institute Certification), a cavallo tra i livelli 1 e 2. Tutto il materiale didattico è disponibile liberamente con licenza Creative Commons BY-NC-SA.
I docenti del corso sono i proff. Giovanni Squillero, Bartolomeo Montrucchio e Fulvio Corno.
Maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/255-master-linux-admin
RDF - Resource Description Framework and RDF SchemaFulvio Corno
An introduction to RDF and RDF Schema. The material is mostly taken from the Semantic Web Recommendations. Slides for the PhD Course on Semantic Web (http://elite.polito.it/).
Tecnologie per la disabilità: presentazione del corsoFulvio Corno
Lezione introduttiva. Materiale relativo al corso di Tecnologie per la Disabilità del Politecnico di Torino (http://bit.ly/tecndisab), Anno Accademico 2011/2012
Introduction to Graphs
Topics:
Definition: Graph
Related Definitions
Applications
Teaching material for the course of "Tecniche di Programmazione" at Politecnico di Torino in year 2012/2013. More information: http://bit.ly/tecn-progr
The tutorial describes existing approaches to model graph databases and different techniques implemented in RDF and Database engines including their main drawbacks when a large volume of interconnected data needs to be traversed.
It is related to Analysis and Design Of Algorithms Subject.Basically it describe basic of topological sorting, it's algorithm and step by step process to solve the example of topological sort.
1. Problema e soluzione
2. I Learning Object
3. Metadati
4. SCORM
Lezione presso il corso di Master in E-Learning per la Pubblica Amministrazione.
Si tratta di un Corso Universitario di Aggiornamento Professionale, finanziato da INPS/INPDAP e progettato in collaborazione con la Città di Torino e la Provincia di Torino, erogato tra maggio 2014 e settembre 2014.
Per maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/247-master-elpa
Componenti dello stack LAMP - PHP, il linguaggio, l'installazione - MySQL, in...Fulvio Corno
Master: Amministratore Linux - Livello Avanzato
Nel contesto della formazione professionale rivolta ad aziende ed enti pubblici, sono stati preparati ed erogati dei corsi di Amministratore di sistemi Linux, al livello base ed al livello avanzato.
Il contenuto del corso è allineato con alcuni moduli della certificazione LPIC (Linux Professional Institute Certification), a cavallo tra i livelli 1 e 2. Tutto il materiale didattico è disponibile liberamente con licenza Creative Commons BY-NC-SA.
I docenti del corso sono i proff. Giovanni Squillero, Bartolomeo Montrucchio e Fulvio Corno.
Maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/255-master-linux-admin
Edifici intelligenti: innovazione tecnologica e convergenza degli impiantiFulvio Corno
Presentazione presso il seminario "IMPIANTI D’ANTENNA: PRESENTE E FUTURO" organizzato dalla Camera di Commercio di Torino il 18/06/2012. http://www.to.camcom.it/Page/t23/view_html?idp=14632
L'intervento illustra il punto di vista della convergenza tecnologica tra i diversi tipi di impanti presenti in una moderna casa intelligente, con particolare attenzione all'interoperabilità. alla standardizzazione ed alla progettazione integrata.
Introduzione alla disabilità.
1. La disabilità: definizione, numeri e domande
2. Tecnologia e approccio alla disabilità
3. La classificazione della disabilità
4. ICF: Classificazione Internazionale del Funzionamento,
della Disabilità e della Salute.
Materiale relativo al corso di Tecnologie per la Disabilità del Politecnico di Torino (http://bit.ly/tecndisab), Anno Accademico 2011/2012
Intelligenza ambientale applicata alla casaFulvio Corno
Seminario tenuto presso la Maison Equipée (Saint Marcel, Aosta, Italia) sul tema della domotica e dell'intelligenza ambientale applicati alla casa intelligente ed al supporto di utenti anziani e disabili.
Lezione presso il corso di Master in E-Learning per la Pubblica Amministrazione.
Si tratta di un Corso Universitario di Aggiornamento Professionale, finanziato da INPS/INPDAP e progettato in collaborazione con la Città di Torino e la Provincia di Torino, erogato tra maggio 2014 e settembre 2014.
Per maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/247-master-elpa
Intervento alla tavola rotonda "La gestione domiciliare del paziente SLA" del XII Workshop SLA (Sclerosi Laterale Amiotrofica) tenutosi a Napoli il 10/11/2012.
Nella presentazione si illustrano le potenzialità della domotica, come degli ausili tecnologici avanzati, per aumentare il grado di autonomia dei pazienti con seri problemi di mobilità, grazie ad una collaborazione tra le varie figure professionali e ad una progettazione incentrata sulla persona.
Attivare facilmente il Prompt dei comandi in Code::BlocksFulvio Corno
Breve tutorial per aggiungere una voce al menù "Tools" di Code::Blocks per aprire rapidamente una finestra "Prompt dei Comandi" già posizionata nella directory che contiene il file eseguibile.
La percezione sensoriale.
1. L’uomo elaboratore di informazione
2. Il meccanismo della percezione
3. L’udito
4. La vista
5. Gli altri sensi.
Materiale relativo al corso di Tecnologie per la Disabilità del Politecnico di Torino (http://bit.ly/tecndisab), Anno Accademico 2011/2012
Master: Amministratore Linux - Livello Base
Nel contesto della formazione professionale rivolta ad aziende ed enti pubblici, sono stati preparati ed erogati dei corsi di Amministratore di sistemi Linux, al livello base ed al livello avanzato.
Il contenuto del corso è allineato con alcuni moduli della certificazione LPIC (Linux Professional Institute Certification), a cavallo tra i livelli 1 e 2. Tutto il materiale didattico è disponibile liberamente con licenza Creative Commons BY-NC-SA.
I docenti del corso sono i proff. Giovanni Squillero, Bartolomeo Montrucchio e Fulvio Corno.
Maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/255-master-linux-admin
Master: Amministratore Linux - Livello Avanzato
Nel contesto della formazione professionale rivolta ad aziende ed enti pubblici, sono stati preparati ed erogati dei corsi di Amministratore di sistemi Linux, al livello base ed al livello avanzato.
Il contenuto del corso è allineato con alcuni moduli della certificazione LPIC (Linux Professional Institute Certification), a cavallo tra i livelli 1 e 2. Tutto il materiale didattico è disponibile liberamente con licenza Creative Commons BY-NC-SA.
I docenti del corso sono i proff. Giovanni Squillero, Bartolomeo Montrucchio e Fulvio Corno.
Maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/255-master-linux-admin
RDF - Resource Description Framework and RDF SchemaFulvio Corno
An introduction to RDF and RDF Schema. The material is mostly taken from the Semantic Web Recommendations. Slides for the PhD Course on Semantic Web (http://elite.polito.it/).
Tecnologie per la disabilità: presentazione del corsoFulvio Corno
Lezione introduttiva. Materiale relativo al corso di Tecnologie per la Disabilità del Politecnico di Torino (http://bit.ly/tecndisab), Anno Accademico 2011/2012
Introduction to Graphs
Topics:
Definition: Graph
Related Definitions
Applications
Teaching material for the course of "Tecniche di Programmazione" at Politecnico di Torino in year 2012/2013. More information: http://bit.ly/tecn-progr
The tutorial describes existing approaches to model graph databases and different techniques implemented in RDF and Database engines including their main drawbacks when a large volume of interconnected data needs to be traversed.
It is related to Analysis and Design Of Algorithms Subject.Basically it describe basic of topological sorting, it's algorithm and step by step process to solve the example of topological sort.
JAVA BASED VISUALIZATION AND ANIMATION FOR TEACHING THE DIJKSTRA SHORTEST PAT...ijseajournal
Shortest path (SP) algorithms, such as the popular Dijkstra algorithm has been considered as the “basic
building blocks” for many advanced transportation network models. Dijkstra algorithm will find the
shortest time (ST) and the corresponding SP to travel from a source node to a destination node.
Applications of SP algorithms include real-time GPS and the Frank-Wolfe network equilibrium.
For transportation engineering students, the Dijkstra algorithm is not easily understood. This paper
discusses the design and development of a software that will help the students to fully understand the key
components involved in the Dijkstra SP algorithm. The software presents an intuitive interface for
generating transportation network nodes/links, and how the SP can be updated in each iteration. The
software provides multiple visual representations of colour mapping and tabular display. The software can
be executed in each single step or in continuous run, making it easy for students to understand the Dijkstra
algorithm. Voice narratives in different languages (English, Chinese and Spanish) are available.A demo
video of the Dijkstra Algorithm’s animation and result can be viewed online from any web browser using
the website: http://www.lions.odu.edu/~imako001/dijkstra/demo/index.html.
Computational complexity: Measure the degree of difficulty of an algorithm
Teaching material for the course of "Tecniche di Programmazione" at Politecnico di Torino in year 2012/2013. More information: http://bit.ly/tecn-progr
Semantic Data Management in Graph Databases: ESWC 2014 TutorialMaribel Acosta Deibe
In this tutorial we present the basis of graph database frameworks and their applicability in semantic data management. The tutorial targets any conference attendee interested in learning about the current graph-based limited capabilities of existing RDF engines, existing graph database techniques, and extensions to RDF data management approaches in order to provide an efficient graph-based access to linked data.
Graphs are the natural data structure to represent relations. Graph algorithms show irregular memory access pattern. This causes, distributed-memory parallel graph algorithms to do more communication than computation. When an algorithm generates more work the more communication they need to do. The amount of work can be reduced with frequent synchronization. However, the overhead of frequent synchronization reduces the performance of distributed-memory parallel graph algorithms. Abstract Graph Machine (AGM) is a model that can control the amount of synchronization and the amount of work generated by an algorithm,
This slide represents topics on PCA (Principal Component Analysis) and SVD (Singular Value Decomposition) where I tried to cover basic PCA, application, and use of PCA and SVD, Important keywords to know about PCA briefly, PCA algorithm and implementation, Basic SVD, SVD calculation, SVD implementation, Performance comparison of SVD and PCA regarding one publicly available dataset.
N.B. Information in this slide are gathered from
1. Machine Learning course by Andrew NG,
2. Mining of Massive Dataset | Stanford University | Artificial Intelligence - All in One (youtube channel)
3. and many more they are described in the slide.
This is the second lecture in the CS 6212 class. Covers asymptotic notation and data structures. Also outlines the coming lectures wherein we will study the various algorithm design techniques.
Graph Summarization with Quality GuaranteesTwo Sigma
Given a large graph, the authors we aim at producing a concise lossy representation (a summary) that can be stored in main memory and used to approximately answer queries about the original graph much faster than by using the exact representation.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
4. Representing graphs
List structures Matrix structures
A.A. 2012/2013Tecniche di programmazione4
Adjacency list
Each vertex has a list of which
vertices it is adjacent to.
For undirected graphs,
information is duplicated
Incidence list
Each vertex has a list of ‘edge’
objects
Edges are represented by a
pair (a tuple if directed) of
vertices (that the edge
connects) and possibly weight
and other data.
Adjacency matrix
A = |V| x |V| matrix of
Booleans or integers
If there is an edge from a
vertex v to a vertex v’, then the
element A[v,v’] is 1, otherwise
0.
Incidence matrix
IM = |V| x |E| matrix of integers
IM[v,e] = 1 (incident), 0 (not
incident)
For directed graphs, may be -1
(out) and +1 (in)
18. Complexity & trade-offs
A.A. 2012/2013Tecniche di programmazione18
Adjacency List Adjacency Matrix Incidence Matrix
Space O( |V| + |E| ) O( |V| x |V| ) O( |V| x |E| )
Space For sparse graphs
|E| << |V|2
For dense graphs
|E| ~ |V|2
Check edge O(1+deg(v)) O(1) O(|E|) if v,v’ are
known, or
O(1) if e is known
Find all adjacent O(1+deg(v)) O(|V|) O(|V|+|E|)
20. JGraphT
A.A. 2012/2013Tecniche di programmazione20
http://jgrapht.org
(do not confuse with
jgraph.com)
Free Java graph library
that provides graph
objects and algorithms
Easy, type-safe and
extensible thanks to
<generics>
Just add jgrapht-
jdk1.6.jar to your
project
21. JGraphT structure
A.A. 2012/2013Tecniche di programmazione21
Packages
org.jgrapht
The front-end API's interfaces and classes,
including Graph, DirectedGraph and UndirectedGraph.
org.jgrapht.alg Algorithms provided with JGraphT.
org.jgrapht.alg.util Utilities used by JGraphT algorithms.
org.jgrapht.demo Demo programs that help to get started with JGraphT.
org.jgrapht.event
Event classes and listener interfaces, used to provide a change
notification mechanism on graph modification events.
org.jgrapht.ext Extensions and integration means to other products.
org.jgrapht.generate Generators for graphs of various topologies.
org.jgrapht.graph Implementations of various graphs.
org.jgrapht.traverse Graph traversal means.
org.jgrapht.util
Non-graph-specific data structures, algorithms, and utilities
used by JGraphT.
22. Graph objects
A.A. 2012/2013Tecniche di programmazione22
All graphs derive from
Interface Graph<V,E>
V = type of vertices
E = type of edges
usually DefaultEdge or DefaultWeightedEdge
Main interfaces
DirectedGraph<V,E>
UndirectedGraph<V,E>
WeightedGraph<V,E>
33. Example
A.A. 2012/2013Tecniche di programmazione33
https://didattica.polito.it/pls/portal30/gap.a_mds
.espandi2?p_a_acc=2013&p_sdu=37&p_cds=3
&p_header=&p_lang=IT
37. Visit Algorithms
A.A. 2012/2013Tecniche di programmazione37
Visit =
Systematic exploration of a graph
Starting from a ‘source’ vertex
Reaching all reachable vertices
Main strategies
Breadth-first visit (“in ampiezza”)
Depth-first visit (“in profondità”)
38. Breadth-First Visit
A.A. 2012/2013Tecniche di programmazione38
Also called Breadth-first search (BFV or BFS)
All reachable vertices are visited “by levels”
L – level of the visit
SL – set of vertices in level L
L=0, S0={ vsource }
Repeat while SL is not empty:
SL+1 = set of all vertices:
not visited yet, and
adjacent to at least one vertex in SL
L=L+1
43. BFS Tree
A.A. 2012/2013Tecniche di programmazione43
The result of a BFV identifies a “visit tree” in the graph:
The tree root is the source vertex
Tree nodes are all graph vertices
(in the same connected component of the source)
Tree are a subset of graph edges
Those edges that have been used to “discover” new vertices.
45. Minimum (shortest) paths
A.A. 2012/2013Tecniche di programmazione45
Shortest path: the minumum number of edges on any
path between two vertices
The BFS procedure computes all minimum paths for all
vertices, starting from the source vertex
NB: unweighted graph : path length = number of edges
46. Depth First Visit
A.A. 2012/2013Tecniche di programmazione46
Also called Breadth-first search (DFV or DFS)
Opposite approach to BFS
At every step, visit one (yet unvisited) vertex, adjacent to
the last visited one
If no such vertex exist, go back one step to the previously
visited vertex
Lends itself to recursive implementation
Similar to tree visit procedures
47. DFS Algorithm
A.A. 2012/2013Tecniche di programmazione47
DFS(Vertex v)
For all ( w : adjacent_to(v) )
If( not visited (w) )
Visit (w)
DFS(w)
Start with: DFS(source)
56. Example
A.A. 2012/2013Tecniche di programmazione56
r s t u
v w x y
Source = s
Back to y
Back to u
Back to t
Back to w
DFS tree
Back to s = STOP
57. Edge classification
A.A. 2012/2013Tecniche di programmazione57
In an directed graph, after a DFS visit, all edges fall in one
of these 4 categories:
T: Tree edges (belonging to the DFS tree)
B: Back edges (not in T, and connect a vertex to one of its
ancestors)
F: Forward edges (not in T and B, and connect a vertex to one
of its descendants)
C: Cross edges (all remaining edges)
61. Cycles
A.A. 2012/2013Tecniche di programmazione61
Theorem:
A directed graph is acyclic if and only if a depth-first visit
does not produce any B edge
62. Complexity
A.A. 2012/2013Tecniche di programmazione62
Visits have linear complexity in the graph size
BFS : O(V+E)
DFS : (V+E)
N.B. for dense graphs, E = O(V2)
64. JGraphT and visits
A.A. 2012/2013Tecniche di programmazione64
Visits are called “traversals”
Implemented through iterator classes
Package org.jgrapht.traverse
66. Graph iterators
A.A. 2012/2013Tecniche di programmazione66
Usual hasNext() and next() methods
May register event listeners to traversal steps
void addTraversalListener(TraversalListener<V,E> l)
TraversalListeners may react to:
Edge traversed
Vertex traversed
Vertex finished
Connected component started
Connected component finished
67. Types of traversal iterators
A.A. 2012/2013Tecniche di programmazione67
BreadthFirstIterator
DepthFirstIterator
ClosestFirstIterator
The metric for closest here is the path length from a start
vertex. Graph.getEdgeWeight(Edge) is summed to calculate
path length. Optionally, path length may be bounded by a finite
radius.
TopologicalOrderIterator
A topological sort is a permutation p of the vertices of
a graph such that an edge {i,j} implies that i appears
before j in p. Only directed acyclic graphs can be topologically
sorted.
68. Resources
A.A. 2012/2013Tecniche di programmazione68
Open Data Structures (in Java), Pat Morin,
http://opendatastructures.org/
Algorithms Course Materials, Jeff Erickson,
http://www.cs.uiuc.edu/~jeffe/teaching/algorithms/
Graphbook - A book on algorithmic graph theory, David
Joyner, MinhVan Nguyen, and David Phillips,
https://code.google.com/p/graphbook/
69. Licenza d’uso
A.A. 2012/2013Tecniche di programmazione69
Queste diapositive sono distribuite con licenza Creative Commons
“Attribuzione - Non commerciale - Condividi allo stesso modo (CC
BY-NC-SA)”
Sei libero:
di riprodurre, distribuire, comunicare al pubblico, esporre in pubblico,
rappresentare, eseguire e recitare quest'opera
di modificare quest'opera
Alle seguenti condizioni:
Attribuzione — Devi attribuire la paternità dell'opera agli autori originali
e in modo tale da non suggerire che essi avallino te o il modo in cui tu
usi l'opera.
Non commerciale — Non puoi usare quest'opera per fini commerciali.
Condividi allo stesso modo — Se alteri o trasformi quest'opera, o se la
usi per crearne un'altra, puoi distribuire l'opera risultante solo con una
licenza identica o equivalente a questa.
http://creativecommons.org/licenses/by-nc-sa/3.0/