a graph search algorithm that solves the single-source shortest path problem for a graph with non-negative edge path costs, producing a shortest path tree. This algorithm is often used in routing and as a subroutine in other graph algorithms.
a graph search algorithm that solves the single-source shortest path problem for a graph with non-negative edge path costs, producing a shortest path tree. This algorithm is often used in routing and as a subroutine in other graph algorithms.
Graphs: Finding shortest paths
Topics:
Definitions
Floyd-Warshall algorithm
Dijkstra algorithm
Bellman-Ford 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
A simple algorithm I devised to enumerate the disjoint paths between a pair of vertices in a given graph. This algorithm was devised as a part of my course-work for Masters [Tech.] at IIT-Banaras Hindu University.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
More Related Content
Similar to AAD_Lec-3-B-ShortestPaths.ppt of design and analysis of algorithm
Graphs: Finding shortest paths
Topics:
Definitions
Floyd-Warshall algorithm
Dijkstra algorithm
Bellman-Ford 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
A simple algorithm I devised to enumerate the disjoint paths between a pair of vertices in a given graph. This algorithm was devised as a part of my course-work for Masters [Tech.] at IIT-Banaras Hindu University.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
Worried about document security while sharing them in Salesforce? Fret no more! Here are the top-notch security standards XfilesPro upholds to ensure strong security for your Salesforce documents while sharing with internal or external people.
To learn more, read the blog: https://www.xfilespro.com/how-does-xfilespro-make-document-sharing-secure-and-seamless-in-salesforce/
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Hivelance Technology
Cryptocurrency trading bots are computer programs designed to automate buying, selling, and managing cryptocurrency transactions. These bots utilize advanced algorithms and machine learning techniques to analyze market data, identify trading opportunities, and execute trades on behalf of their users. By automating the decision-making process, crypto trading bots can react to market changes faster than human traders
Hivelance, a leading provider of cryptocurrency trading bot development services, stands out as the premier choice for crypto traders and developers. Hivelance boasts a team of seasoned cryptocurrency experts and software engineers who deeply understand the crypto market and the latest trends in automated trading, Hivelance leverages the latest technologies and tools in the industry, including advanced AI and machine learning algorithms, to create highly efficient and adaptable crypto trading bots
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
AAD_Lec-3-B-ShortestPaths.ppt of design and analysis of algorithm
1. AAD CSE SRMAP 1
Shortest Paths
C
B
A
E
D
F
0
3
2
8
5 8
4
8
7 1
2 5
2
3 9
2. AAD CSE SRMAP 2
Weighted Graphs
In a weighted graph, each edge has an associated numerical
value, called the weight of the edge
Edge weights may represent, distances, costs, etc.
Example:
In a flight route graph, the weight of an edge represents the
distance in miles between the endpoint airports
ORD
PVD
MIA
DFW
SFO
LAX
LGA
HNL
3. AAD CSE SRMAP 3
Shortest Path Problem
Given a weighted graph and two vertices u and v, we want to
find a path of minimum total weight between u and v.
Length of a path is the sum of the weights of its edges.
Example:
Shortest path between Providence and Honolulu
Applications
Internet packet routing
Flight reservations
Driving directions
ORD
PVD
MIA
DFW
SFO
LAX
LGA
HNL
4. AAD CSE SRMAP 4
Shortest Path Properties
Property 1:
A subpath of a shortest path is itself a shortest path
Property 2:
There is a tree of shortest paths from a start vertex to all the other
vertices
Example:
Tree of shortest paths from Providence
ORD
PVD
MIA
DFW
SFO
LAX
LGA
HNL
5. Dijkstra’s Algorithm
U Designated node
Set1 Remaining nodes
Repeat
{
In the mapping between U and Set1 find V which
is the minimum weight(distance) vertex from U.
Remove V from Set1.
Improve the weights(distances) from U to all
other nodes through V
}
Until set1 is empty
AAD CSE SRMAP 5
7. AAD CSE SRMAP 7
Dijkstra’s Algorithm
The distance of a vertex
v from a vertex s is the
length of a shortest path
between s and v
Dijkstra’s algorithm
computes the distances
of all the vertices from a
given start vertex s
Assumptions:
the graph is connected
the edges are
undirected
the edge weights are
nonnegative
We grow a “cloud” of vertices,
beginning with s and eventually
covering all the vertices
We store with each vertex v a
label d(v) representing the
distance of v from s in the
subgraph consisting of the cloud
and its adjacent vertices
At each step
We add to the cloud the vertex
u outside the cloud with the
smallest distance label, d(u)
We update the labels of the
vertices adjacent to u
8. AAD CSE SRMAP 8
Edge Relaxation
Consider an edge e = (u,z)
such that
u is the vertex most recently
added to the cloud
z is not in the cloud
The relaxation of edge e
updates distance d(z) as
follows:
d(z) min{d(z),d(u) + weight(e)}
d(z) = 75
d(u) = 50
z
s
u
d(z) = 60
d(u) = 50
z
s
u
e
e
9. AAD CSE SRMAP 9
Example
C
B
A
E
D
F
0
4
2
8
4
8
7 1
2 5
2
3 9
C
B
A
E
D
F
0
3
2
8
5 11
4
8
7 1
2 5
2
3 9
C
B
A
E
D
F
0
3
2
8
5 8
4
8
7 1
2 5
2
3 9
C
B
A
E
D
F
0
3
2
7
5 8
4
8
7 1
2 5
2
3 9
10. AAD CSE SRMAP 10
Example (cont.)
C
B
A
E
D
F
0
3
2
7
5 8
4
8
7 1
2 5
2
3 9
C
B
A
E
D
F
0
3
2
7
5 8
4
8
7 1
2 5
2
3 9
11. AAD CSE SRMAP 11
Dijkstra’s Algorithm
A priority queue stores
the vertices outside the
cloud
Key: distance
Element: vertex
Locator-based methods
insert(k,e) returns a
locator
replaceKey(l,k) changes
the key of an item
We store two labels
with each vertex:
Distance (d(v) label)
locator in priority
queue
Algorithm DijkstraDistances(G, s)
Q new heap-based priority queue
for all v G.vertices()
if v = s
setDistance(v, 0)
else
setDistance(v, )
l Q.insert(getDistance(v), v)
setLocator(v,l)
while Q.isEmpty()
u Q.removeMin()
for all e G.incidentEdges(u)
{ relax edge e }
z G.opposite(u,e)
r getDistance(u) + weight(e)
if r < getDistance(z)
setDistance(z,r)
Q.replaceKey(getLocator(z),r)
12. AAD CSE SRMAP 12
Analysis
Graph operations
Method incidentEdges is called once for each vertex
Label operations
We set/get the distance and locator labels of vertex z O(deg(z)) times
Setting/getting a label takes O(1) time
Priority queue operations
Each vertex is inserted once into and removed once from the priority
queue, where each insertion or removal takes O(log n) time
The key of a vertex in the priority queue is modified at most deg(w)
times, where each key change takes O(log n) time
Dijkstra’s algorithm runs in O((n + m) log n) time provided the
graph is represented by the adjacency list structure
Recall that Sv deg(v) = 2m
The running time can also be expressed as O(m log n) since the
graph is connected
13. AAD CSE SRMAP 13
Extension
Using the template
method pattern, we
can extend Dijkstra’s
algorithm to return a
tree of shortest paths
from the start vertex
to all other vertices
We store with each
vertex a third label:
parent edge in the
shortest path tree
In the edge relaxation
step, we update the
parent label
Algorithm DijkstraShortestPathsTree(G, s)
…
for all v G.vertices()
…
setParent(v, )
…
for all e G.incidentEdges(u)
{ relax edge e }
z G.opposite(u,e)
r getDistance(u) + weight(e)
if r < getDistance(z)
setDistance(z,r)
setParent(z,e)
Q.replaceKey(getLocator(z),r)
14. AAD CSE SRMAP 14
Why Dijkstra’s Algorithm
Works
Dijkstra’s algorithm is based on the greedy
method. It adds vertices by increasing distance.
C
B
A
E
D
F
0
3
2
7
5 8
4
8
7 1
2 5
2
3 9
Suppose it didn’t find all shortest
distances. Let F be the first wrong
vertex the algorithm processed.
When the previous node, D, on the
true shortest path was considered,
its distance was correct.
But the edge (D,F) was relaxed at
that time!
Thus, so long as d(F)>d(D), F’s
distance cannot be wrong. That is,
there is no wrong vertex.
15. AAD CSE SRMAP 15
Why It Doesn’t Work for
Negative-Weight Edges
If a node with a negative
incident edge were to be added
late to the cloud, it could mess
up distances for vertices already
in the cloud.
C
B
A
E
D
F
0
4
5
7
5 9
4
8
7 1
2 5
6
0 -8
Dijkstra’s algorithm is based on the greedy
method. It adds vertices by increasing distance.
C’s true distance is 1, but
it is already in the cloud
with d(C)=5!
16. All-Pairs Shortest Paths
From all nodes {
To All nodes{
Through all nodes{
Improve the distances }}}
AAD CSE SRMAP 16
17. AAD CSE SRMAP 17
All-Pairs Shortest Paths
Find the distance
between every pair of
vertices in a weighted
directed graph G.
We can make n calls to
Dijkstra’s algorithm (if no
negative edges), which
takes O(nmlog n) time.
Likewise, n calls to
Bellman-Ford would take
O(n2m) time.
We can achieve O(n3)
time using dynamic
programming (similar to
the Floyd-Warshall
algorithm).
Algorithm AllPair(G) {assumes vertices 1,…,n}
for all vertex pairs (i,j)
if i = j
D0[i,i] 0
else if (i,j) is an edge in G
D0[i,j] weight of edge (i,j)
else
D0[i,j] +
for k 1 to n do
for i 1 to n do
for j 1 to n do
Dk[i,j] min{Dk-1[i,j], Dk-1[i,k]+Dk-1[k,j]}
return Dn
k
j
i
Uses only vertices
numbered 1,…,k-1 Uses only vertices
numbered 1,…,k-1
Uses only vertices numbered 1,…,k
(compute weight of this edge)