0% found this document useful (0 votes)
21 views2 pages

Sensus3-An Android App To Find Shortest Path On The Map: Structure

This document describes an Android app called Sensus3 that finds the shortest path on a map using Dijkstra's algorithm. The app takes in map data of 8 curves and 8 nodes and assigns weights to each edge based on length. It allows the user to long press on the map to select a source and destination. If the source and destination are on the same curve, it will directly display the path without running Dijkstra's algorithm. Otherwise, it dynamically inserts the source and destination as nodes and runs Dijkstra's to find the shortest path, which is then drawn on the map. It addresses problems such as inserting nodes dynamically and assigning weights to dynamic nodes.

Uploaded by

nanadeemansari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Sensus3-An Android App To Find Shortest Path On The Map: Structure

This document describes an Android app called Sensus3 that finds the shortest path on a map using Dijkstra's algorithm. The app takes in map data of 8 curves and 8 nodes and assigns weights to each edge based on length. It allows the user to long press on the map to select a source and destination. If the source and destination are on the same curve, it will directly display the path without running Dijkstra's algorithm. Otherwise, it dynamically inserts the source and destination as nodes and runs Dijkstra's to find the shortest path, which is then drawn on the map. It addresses problems such as inserting nodes dynamically and assigning weights to dynamic nodes.

Uploaded by

nanadeemansari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Sensus3- An Android App to find shortest path on the Map

Structure:
The Map data of 8 Curves and 8 Nodes are fed into the database. To run Dijkstras
Algorithm on the Map data we consider each Curve as Edge.
After getting the Map data for Edges and Nodes we smoothed the Edge by using
Savizky-Golay filter. Then the weight of each Edge is assigned according to its length.
The user long clicks on the map to navigate. As soon as the Map is long clicked , the
destination is retrieved and matched on the Map using Range Query algorithm. Then
the source location is retrieved using GPS(Network data). Since Network data is
incorrect we again match it on the Map using Range Query.
Source and Destination is also considered as Node and both are dynamically inserted
in the Graph. As a result, at runtime, we have 10 Nodes and 10 Edges.
We get the shortest path after performing Dijkstras algorithm and the retrieved
shortest path is drawn on the Map using PolyLines.

Problems faced-
1. Source and Destination node cannot be on the same Edge. According to our
algorithm only one Node can be dynamically inserted on an Edge.
Solution- Check if Source and Destination lie on the same Curve. If yes, then straight
away display the path. No need to perform Dikstras algorithm.

2. Algorithm to insert Node dynamically.
Solution- We know the Curves on which source and destination lie. We name it
SourceCurve and DestinationCurve. The Nodes connected to the SourceCurve and
DestinationCurve is retrieved. These are the Nodes to modify. Now, we insert a Source
Node on SourceCurve and Detination Node on DestinationCurve.

3. How to assign weights to the dynamically inserted Node?
Soultion- Calculate distance from both adjacent Node to the inserted Node. Assign the
smaller distance to the closer Node.

4. How to draw PolyLines from Source Node to next Node and Destination Node to
previous Node?
Solution- Retrieve the location of Source Node on SourceCurve. Then search for the
next Node in both directions of SourceCurve. As soon as the next node is found, draw
the line. Simlary we do for Destination Node.

You might also like