```
Software Engineering
Evaluating and designing solutions for 4 mapping problems.
Kevin Lin, with thanks to many others.
1
Arbitrary Challenging Problem of the Day
Given a weighted graph, find the second-shortest path from a source to a goal vertex.
Given a weighted graph, find the kth-shortest path from a source to a goal vertex.
2
Q
B
C
A
s
5
5
D
1
2
1
0
1
2
4
ACBD
ACD
ABD
?: Dijkstra’s relies on computing the shortest paths tree. What about a second-shortest paths tree?
Q1: Given a weighted graph, find the second-shortest path from a source to a goal vertex.
Q2: Given a weighted graph, find the kth-shortest path from a source to a goal vertex.
Arbitrary Challenging Problem of the Day
Given a weighted graph, find the second-shortest path from a source to a goal vertex.
Given a weighted graph, find the kth-shortest path from a source to a goal vertex.
3
A
B
C
A
s
5
5
D
1
2
1
0
1
2
4
ACBD
ACD
ABD
k-Dijkstra’s
PQ.add(s, 0)pathTo[s][0] = [s]; distTo[s][0] = 0For all vertices v, count[v] = 0While PQ is not empty:
pi = PQ.removeSmallest()count[p] += 1If p is goal: add pathTo[p][i] to result If count[goal] is k: returnIf count[p] ≤ k: relax all edges from pi
Relaxing an edge (v, w) with weight:
distTo[w].add(distTo[v][i] + weight)pathTo[w].add(pathTo[v][i] + w)PQ.add(w, distTo[w].getLast())
The Dijkstra’s shortest path to a vertex is only correct when the vertex is visited!
Invariants
pi: ith-relaxed copy of p.
pathTo[v][i]: ith-relaxed path to v.
distTo[v][i]: ith-relaxed distance to v.
count[v]: number of shortest paths to v.
4
5
Software Product Development Lifecycle
Analyzing the problem
Market research
Gathering requirements for the proposed business solution
Devising a plan or design for the software-based solution
Implementation (coding) of the software
Testing the software
Deployment
Maintenance and bug fixing
6
Software Development (Wikipedia)
Software Product Development Lifecycle
Analyzing the problem
Market research
Gathering requirements for the proposed business solution
Devising a plan or design for the software-based solution
Implementation (coding) of the software
Testing the software
Deployment
Maintenance and bug fixing
7
Software Development (Wikipedia)
Technical Audits
What are the definitions of success? Does the system that we built produce the right output given the known constraints?
What are the biases in the data? Do we understand the biases and limitations of the system and the output?
What is the cost of failure? How often are there errors, and for whom does this model fail? Are those clear to the user so that our tool cannot enable poor decision-making or inaccurate impressions?
What are the long-term effects and feedback loops? What are the true social and environmental costs of the service?
8
The era of blind faith in big data must end (Cathy O’Neil/TED), Be Careful What You Code For (danah boyd/Medium)
9
Wheelchair-Accessible Routes
Problem. Some routes present challenges for people with mobility needs.
A solution. Run k-Dijkstra’s and filter by paths that meet mobility needs.
Evaluate this solution.
How might we address this problem in a different way? Evaluate your solution.
Q
?: What are the definitions of success?
?: What are the biases in the data?
?: What is the cost of failure?
?: What are the long-term effects and feedback loops?
Q1: Evaluate this solution.
Q2: How might we address this problem in a different way? Evaluate your solution.
10
Wheelchair-Accessible Routes
Problem. Some routes present challenges for people with mobility needs.
A solution. Run k-Dijkstra’s and filter by paths that meet mobility needs.
Evaluate this solution.
How might we address this problem in a different way? Evaluate your solution.
A
Shooter Events
Problem. During shooter events, people need to make informed decisions.
Give a description and evaluation of Google Maps’ solution.
How might we address this problem? Evaluate your solution.
11
Q
?: What are the definitions of success?
?: What are the biases in the data?
?: What is the cost of failure?
?: What are the long-term effects and feedback loops?
Q1: Give a description and evaluation of Google Maps’ solution.
Q2: How might we address this problem in a different way? Evaluate your solution.
Shooter Events
Problem. During shooter events, people need to make informed decisions.
How might we address this problem? Evaluate your solution.
12
A
Safety Routing
Problem. Users can unknowingly walk into dangerous situations.
A solution. Reroute users in real-time based to avoid potentially dangerous situations.
Evaluate this solution.
How might we address this problem in a different way? Evaluate your solution.
13
Q
?: What are the definitions of success?
?: What are the biases in the data?
?: What is the cost of failure?
?: What are the long-term effects and feedback loops?
Q1: Evaluate this solution.
Q2: How might we address this problem in a different way? Evaluate your solution.
Safety Routing
Problem. Users can unknowingly walk into dangerous situations.
A solution. Reroute users in real-time based to avoid potentially dangerous situations.
Evaluate this solution.
How might we address this problem in a different way? Evaluate your solution.
14
A
```