How can one write an algorithm to get to some location in your home town eg for a local friend or a friend from out of town | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can one write an algorithm to get to some location in your home town eg for a local friend or a friend from out of town

21st Mar 2019, 9:20 PM
Walter Chavundura
Walter Chavundura - avatar
21 Answers
+ 1
there are some pathfinding algorithms like "A* pathfinding algorithm" for that sort of stuff.
21st Mar 2019, 9:26 PM
Anton Böhler
Anton Böhler - avatar
+ 1
A follow up to my question. Using python programming language.
21st Mar 2019, 9:29 PM
Walter Chavundura
Walter Chavundura - avatar
+ 1
Simple
21st Mar 2019, 9:33 PM
Walter Chavundura
Walter Chavundura - avatar
+ 1
Let me check it. But I am not familiar with java. And I have just started learning python.
21st Mar 2019, 9:38 PM
Walter Chavundura
Walter Chavundura - avatar
+ 1
Not yet. I can make grocery lists
21st Mar 2019, 9:48 PM
Walter Chavundura
Walter Chavundura - avatar
+ 1
So for a Pathfinding algorithm you will need to know what 2dimensional lists are and it would be good if you knew what objects are. You can find multiple tutorials on A* or others on the web ...
21st Mar 2019, 9:55 PM
Anton Böhler
Anton Böhler - avatar
+ 1
well you probably could somehow insert a map but it's easier if you just have a grid with cells and some cells in there are obstacles. the second question i don't really get... do you mean that the algorithm works on any point in the grid or what?
21st Mar 2019, 10:01 PM
Anton Böhler
Anton Böhler - avatar
+ 1
definitly yes
21st Mar 2019, 10:07 PM
Anton Böhler
Anton Böhler - avatar
+ 1
That's great. Let me c if I can find my way. I will post tomorrow. Thanks for your time
21st Mar 2019, 10:28 PM
Walter Chavundura
Walter Chavundura - avatar
0
well it depends on how acurate you want it. if you want sth. with geolocation and that I can't help you. If you mean simple like in a grid from point A to B with obstacles, then I can help you
21st Mar 2019, 9:32 PM
Anton Böhler
Anton Böhler - avatar
0
great 😂 well I made an algoritm once like that, but with Javascript ... https://code.sololearn.com/WKrgz25kab1z/?ref=app its not super efficient but its not hard
21st Mar 2019, 9:36 PM
Anton Böhler
Anton Böhler - avatar
0
how well do you know lists and objects? Oh and don't worry the code looks complicated but thats only because I'm really bad at structuring my code(s) 😅
21st Mar 2019, 9:41 PM
Anton Böhler
Anton Böhler - avatar
0
List I can
21st Mar 2019, 9:43 PM
Walter Chavundura
Walter Chavundura - avatar
0
ok ...can you make 2dimensinal lists?
21st Mar 2019, 9:47 PM
Anton Böhler
Anton Böhler - avatar
0
since you don't know objects yet you will have to make multiple 2d lists and store some information in them
21st Mar 2019, 9:49 PM
Anton Böhler
Anton Böhler - avatar
0
Can you give me what I should know so that I can research on it. The thing is I don't have a clue of how to solve that problem
21st Mar 2019, 9:49 PM
Walter Chavundura
Walter Chavundura - avatar
0
ok a 2d list is sth like this [ [0, 1], [1, 2] ] its basicly a list of lists; this way we can represent a grid
21st Mar 2019, 9:51 PM
Anton Böhler
Anton Böhler - avatar
0
Let me check on this. Do you have to have a map inserted. Can the program be used from an point or its for a single path/ way only?????
21st Mar 2019, 9:56 PM
Walter Chavundura
Walter Chavundura - avatar
0
Was saying is it possible to have an input of the starting point anywhere on the grid then the program leads U to the destination.
21st Mar 2019, 10:05 PM
Walter Chavundura
Walter Chavundura - avatar
0
I get the impression you gave up... 😅😅😅
15th Apr 2019, 7:41 PM
Anton Böhler
Anton Böhler - avatar