A-Star A* Search in Python [Python Maze World- pyamaze]

Поділитися
Вставка
  • Опубліковано 13 жов 2024

КОМЕНТАРІ • 82

  • @Waseek69Ahmad
    @Waseek69Ahmad 2 роки тому +9

    The amount of effort you have put in these videos is amazing. I just coded all these algos on a mobile app using Flutter framework. Thank you for this 💚

  • @zladsmusic8953
    @zladsmusic8953 2 роки тому +5

    I am a student in Com Sci and this was very well explained, thank you!!

  • @Ogachi98
    @Ogachi98 Рік тому +2

    Your videos are so informative, please create a Genetic algorithm too in the future. thanks for the excellent job

    • @LearningOrbis
      @LearningOrbis  Рік тому

      Thanks a lot. Yes I will plan Genetic Algorithm in near future.

  • @mals62
    @mals62 3 місяці тому

    Towards the end, I am confused at the part where only the highlighted part is getting separated. How exactly does that happen?

  • @anwar-gc5kv
    @anwar-gc5kv 2 роки тому +4

    Excellent video with great explanation. Thanks a lot!

  • @amethyst1044
    @amethyst1044 2 роки тому +1

    I installed pyamaze as indicated in the video, but whenever I try to execute, I always get : ImportError : No module named pyamaze. I checked the installation, and it has been confirmed that it was installed in my python 3.6 version, and I don't get any syntax or wahtever error in the code neither. Do you know what the problem might be? Documentation is not really available ://
    And thank you in advance !

    • @LearningOrbis
      @LearningOrbis  2 роки тому

      hello, Thanks for contacting.
      You can find the package here: pypi.org/project/pyamaze/
      The easiest way to install any package is by the following command on the command window:
      >> pip install pyamaze
      There can be some general path issues as well. For that, you can watch my other video here: ua-cam.com/video/SIhH-rsaADY/v-deo.html
      Finally, if nothing works, you can simply copy-paste the module code from here: github.com/MAN1986/pyamaze/blob/main/pyamaze/pyamaze.py
      All you need is to create a new file named as pyamaze.py in your working folder and copy-paste the code provided above.
      Let me know if the issue is resolved!

  • @onemore4219
    @onemore4219 Рік тому

    Assalam_O_Alaikum! Sir if there is no path in the maze then is it still work? If not then what conditions we should add and where we should add them so that if there is no path then this program terminate and print some message like "no path found"?

    • @LearningOrbis
      @LearningOrbis  Рік тому +1

      WaAlaikumSalam, I have not added such condition because there is always a path.
      But suppose you change the map manually and there is no path then you can add one condition like after certain amount of steps you may declare there is no path available. There can be condition on length of the path scanned which may be linked to maze height and width.

  • @ignatiolu863
    @ignatiolu863 2 роки тому +1

    How could I cache visited states (children) to improve computation speed? Also thank you for a wonderful explanation!

    • @LearningOrbis
      @LearningOrbis  2 роки тому +1

      Hello! If you see the code aStarDemo.py (the link provided in the description), the visited states are being stored in a list. But that will not improve the computation speed.
      For computation speed, the heuristic function is very important and you can find the detail of the heuristic function in the next video:
      ua-cam.com/video/-igjC-VoHas/v-deo.html

  • @JHOHANSTIWARGIRALDOESCALANTE
    @JHOHANSTIWARGIRALDOESCALANTE 6 місяців тому

    hi! I come from the other video (dijkstra) and mate, I shall comment here too, it is a life saver, I've been trying to find something like this for hours after trying a hole week to program something like that with pygame, tkinter and some other things, but mate }you really did well, again thank you

  • @PaidiGeetesh
    @PaidiGeetesh 6 місяців тому

    really good video

  • @yourtravelpostcard
    @yourtravelpostcard 8 місяців тому

    The code explanation was a bit fast but I will try it on my machine once and maybe I will get it then but thank you good work

  • @anikethpatil2547
    @anikethpatil2547 Рік тому

    Sir i am getting error at
    aStar(m)
    And
    currCell = open.get()[2]
    as
    TypeError int object is not subscriptable

    • @LearningOrbis
      @LearningOrbis  Рік тому

      Have you tried the demo code given at:
      github.com/MAN1986/pyamaze/tree/main/Demos/A-Star

  • @shivamdixit5634
    @shivamdixit5634 2 роки тому +1

    How can we change the end and start coordinates?

    • @LearningOrbis
      @LearningOrbis  2 роки тому

      Dear Shivam, its very simple to change the start and goal cell. You can watch the starting video (ua-cam.com/video/McMU-WuJwG0/v-deo.html).
      Secondly, if you see the source code file aStarDemo.py , given in the description, you can find a different start and goal cell code from line 71 onwards (commented).

  • @ctrlintelligence4264
    @ctrlintelligence4264 2 роки тому

    search length (visited nodes) ? how did u do ?

    • @LearningOrbis
      @LearningOrbis  2 роки тому +1

      Hello Nevidu,
      If you check the code of aStarDemo.py (given in the description), on line number 18 and 21 you can see how the search space is saved as a list.

  • @osama6795
    @osama6795 2 роки тому

    what do you mean by g sore and f score?

    • @LearningOrbis
      @LearningOrbis  2 роки тому

      I have explained that in detail starting from 02:00.
      g Score of any cell is the actual cost from start cell to that cell.
      h Score is expected cost to reach to goal cell from any cell.
      f Score is sum of the two.

  • @eshasharma568
    @eshasharma568 Рік тому

    Sir, I am getting an error in line 23, m.maze_map[currCell][d]==True

  • @anwar-gc5kv
    @anwar-gc5kv 2 роки тому

    I follow each lines of your code in this video and I got errors at line, path = aStarSearch(m) and line, forwardPath[aStarSearchPath[cell]] = cell. This might be wrong with insertion into dictionary (same key). How can I fix this? Please help

    • @LearningOrbis
      @LearningOrbis  2 роки тому

      Please send me the code at mahsan.naeem@gmail.com

    • @varkam1523
      @varkam1523 2 роки тому

      i have the same problem bro
      Can you pls tell what you did to sort out the issue

    • @anwar-gc5kv
      @anwar-gc5kv 2 роки тому

      @@varkam1523 I asked my friend to help me. Sorry that I cant help u.

    • @LearningOrbis
      @LearningOrbis  2 роки тому

      @@varkam1523 Please tell what problem you are facing. The code I provided in description is working fine. It is given here:
      github.com/MAN1986/pyamaze/blob/main/Demos/A-Star/aStar.py

  • @babaabba9348
    @babaabba9348 3 роки тому

    good video, can you please upload a video where you implement bfs in order to solve the knapsack problem

    • @LearningOrbis
      @LearningOrbis  3 роки тому +1

      Thanks but I haven't implemented knapsack algorithm yet. Will try in future.

    • @babaabba9348
      @babaabba9348 3 роки тому

      @@LearningOrbis
      thanks in advance sir for all your effort

  • @osama6795
    @osama6795 2 роки тому

    how can i draw numbers on the side of the maze and the bottom? for instance 1,2,3,4,5 for the left side and 1,2,3,4,5 for the bottom?

    • @LearningOrbis
      @LearningOrbis  2 роки тому +1

      For that you will have to modify the class code. In pyamaze module inside the maze class there is a method _drawMaze which uses tkinter to draw maze.

    • @osama6795
      @osama6795 2 роки тому

      @@LearningOrbis there isn't any easier alternative?

    • @LearningOrbis
      @LearningOrbis  2 роки тому

      All drawings are done using the tkinter framework and the canvas is named as self._canvas inside the maze class. You will have to access that and add other content on the canvas like the row/column number.
      You can access the canvas outside the class and draw extra things.

    • @osama6795
      @osama6795 2 роки тому

      @@LearningOrbis i found it, what would be an example code to draw the numbers on each side using tkinter?

    • @LearningOrbis
      @LearningOrbis  2 роки тому +1

      You should learn tkinter basics first and then can find the suitable way. I used this reference for tkinter:
      anzeljg.github.io/rin2/book2/2405/docs/tkinter/index.html

  • @edmundquarm9387
    @edmundquarm9387 2 роки тому

    I wish this was doing using pacman. Great video though. Thanks

  • @JHOHANSTIWARGIRALDOESCALANTE
    @JHOHANSTIWARGIRALDOESCALANTE 6 місяців тому

    life saver, really ty

  • @HONKAI_WORLD_OF_JOY
    @HONKAI_WORLD_OF_JOY 7 місяців тому

    How for cell (2,4) : West & South are open.
    Ref: 12:43
    Ref: 12:11
    West Cell is open? How?
    I can see only South cell is open 😨
    #please kindly clear my confusion anyone

    • @LearningOrbis
      @LearningOrbis  7 місяців тому

      Hi,
      Yes there is little confusion I guess. The maze I generated in video might be different from the the maze map shown.
      I suggest you execute the code given at 12:43 and you will see a random maze. Match the maze_map and generated maze.
      Let me know if there is any confusion!

  • @devansh6720
    @devansh6720 Рік тому

    Sir,how it ignored the walls

    • @LearningOrbis
      @LearningOrbis  Рік тому

      What do you mean? It knows the map and if there is a wall it doesn't go there. I suggest watching the first video where I have explained everything about pyamaze: ua-cam.com/video/McMU-WuJwG0/v-deo.html

  • @teeranaisilarak4277
    @teeranaisilarak4277 2 роки тому

    Awesom! video ^^

  • @mohammadjarrah9827
    @mohammadjarrah9827 2 роки тому

    The code in the description you've put it about 800 lines.
    How?

    • @LearningOrbis
      @LearningOrbis  2 роки тому

      That is the code of pyamaze module. The code for A-star and other search algorithms is of few lines.
      You don't need the code of 800 lines. You can simply install pyamaze module. Please watch the second video of the playlist that explains how to use the pyamaze module.

  • @YashPrajapati-js8zd
    @YashPrajapati-js8zd 2 роки тому +1

    thank you brother

  • @amanialkhaldi7626
    @amanialkhaldi7626 2 роки тому

    how i can create buttons to start object move stop it and go back

    • @LearningOrbis
      @LearningOrbis  2 роки тому

      For that you will have to update the module code accordingly.

    • @amanialkhaldi7626
      @amanialkhaldi7626 2 роки тому

      @@LearningOrbis how if you please can explain

    • @LearningOrbis
      @LearningOrbis  2 роки тому +1

      It's not straight forward. Will require a rigorous rework. You will have to understand the module code. Should have good experience of working with Tkinter and then can modify the code accordingly.

  • @eminkazdaloglu7404
    @eminkazdaloglu7404 2 роки тому

    I guess, you saved my life!

  • @hieuvameomeo
    @hieuvameomeo 2 роки тому

    great video, I learned a lot
    Thanks!

  • @zohaibhassan4256
    @zohaibhassan4256 11 місяців тому

    I follow every step but i get errors

    • @LearningOrbis
      @LearningOrbis  11 місяців тому

      Which error?
      Have you tried this code: github.com/MAN1986/pyamaze/tree/main/Demos/A-Star

  • @andym3695
    @andym3695 2 роки тому

    thank you is good Astar

  • @nikamsrushti5878
    @nikamsrushti5878 2 роки тому +1

    can you pls upload source code

    • @LearningOrbis
      @LearningOrbis  2 роки тому

      Please check the description. Code links are provided.

  • @ZakirHussain-nd4fw
    @ZakirHussain-nd4fw Рік тому

    Walekumassalam