Breadth First Search (BFS) in Python [Python Maze World- pyamaze]

Sdílet
Vložit
  • čas přidán 4. 07. 2024
  • Python Maze World
    In this series we will learn about different Maze Search Algorithm in Python e.g., Depth First Search (DFS), Breadth First Search (BFS), A-Star Search, Dijkstra's Algorithm and many other possible search and navigation algorithms like Wall Following Robot, Reinforcement Learning, Genetic Algorithm etc.
    This video is about Breadth First Search (BFS).
    (00:00) Introduction
    (03:22) What is Queue
    (04:49) Pseudocode
    (08:18) Python Code Development
    ⭐⭐Depth First Search (DFS) Implementation:
    • Depth First Search (DF...
    ⭐⭐A-star (A*) Search Implementation:
    • A-Star A* Search in Py...
    ⭐⭐Comparison of DFS, AFS and A*
    • DFS BFS and A* Search ...
    ⭐⭐Dijkstra's Algorithm:
    • Dijkstra Shortest Path...
    You can download the package as:
    pip install pyamaze
    Or you can copy the module code from here:
    github.com/MAN1986/pyamaze/bl...
    The used demo file is here :
    github.com/MAN1986/pyamaze/tr...
    How to use pyamaze module:
    • Maze Generation and Se...
    What is __name__=='__main__':
    • [Python Programming Ba...
    Here is the Playlist:
    • AI Search Algorithms u...
    #Python #pyamaze #Python

Komentáře • 40

  • @isaiahwillie1671
    @isaiahwillie1671 Před 2 měsíci

    bro you was so useful

  • @Waseek69Ahmad
    @Waseek69Ahmad Před 2 lety

    Kudoos Bro! Loved to see such a clear and illustrative explanation by a fellow Pakistani CS lad 🇵🇰💚

  • @inhazfahim8270
    @inhazfahim8270 Před 2 lety +1

    Very clear tutorial..may Allah bless you..

  • @dallasdominguez9501
    @dallasdominguez9501 Před 2 lety

    Another fantastic tutorial 👍

  • @solidworksforbeginnersin2053

    Ma Sha ALLAH Sir

  • @mangutek
    @mangutek Před 6 měsíci +1

    Is there any way to find all posible paths?

  • @EW-mb1ih
    @EW-mb1ih Před 2 lety +3

    what's the point of the queue module if we can pretty easily simulate the behavior of a queue using list?

    • @LearningOrbis
      @LearningOrbis  Před 2 lety +1

      As far result is concerned both are giving the same output but popping an element from queue or deque is faster as compared to list.
      We can perform all set operations using the list, but the set operations defined in Set class are much faster than that of the list and that is the reason to have the Set class.
      Same goes for queue and deque i.e. fast result.

    • @ikrammaududi6205
      @ikrammaududi6205 Před měsícem

      ​@@LearningOrbis nice info bro

  • @babaabba9348
    @babaabba9348 Před 2 lety

    salamo alaykom thank you my brother for your clear explaination

    • @LearningOrbis
      @LearningOrbis  Před 2 lety +1

      WaAlaikumSalam,
      Thanks a lot and stay connected for more Maze search algorithms!

    • @babaabba9348
      @babaabba9348 Před 2 lety

      @@LearningOrbis
      I have a question, can I apply your algorithm in order to solve knapsack problem?

    • @LearningOrbis
      @LearningOrbis  Před 2 lety +1

      As far this module is concerned, it is created for Maze problems. But in general you can use BFS, DFS or Branch and Bound to solve Knapsack problem.

    • @LearningOrbis
      @LearningOrbis  Před 2 lety +1

      Check this out:
      cs.franklin.edu/~shaffstj/cs319/week12.htm#Breadth-First%200-1%20Knapsack%20Problem

    • @babaabba9348
      @babaabba9348 Před 2 lety

      @@LearningOrbis
      absolutely

  • @abuhurairah1842
    @abuhurairah1842 Před 2 měsíci

    At the end of pseudo code when you have found the goal cell,then how to traverse from (5,5) to (1,1)?

  • @HuyNguyen-xx9rr
    @HuyNguyen-xx9rr Před měsícem

    Hello, I found your documentation very useful but can you tell me more about how to handle it if someone wants to enter input and end points from the keyboard?

    • @LearningOrbis
      @LearningOrbis  Před měsícem +1

      Sorry that option is not included!

    • @HuyNguyen-xx9rr
      @HuyNguyen-xx9rr Před měsícem

      ​@@LearningOrbis So that means the above method can only illustrate the available algorithm with given points and cannot be entered from the keyboard, right? I need some way to help users enter from the keyboard :((

    • @LearningOrbis
      @LearningOrbis  Před měsícem +1

      You can change the start and goal, size of maze etc, but with the code. Have you seen the first video where I have explained everything?
      czcams.com/video/McMU-WuJwG0/video.html

  • @jansernchang6946
    @jansernchang6946 Před rokem

    What if a cell is allowed to be visited at most thrice? How to implement this in the code?

    • @LearningOrbis
      @LearningOrbis  Před rokem +1

      If you watch the first video of the playlist, you will understand the use of pyamaze module. The different search algorithms implemented in the playlist are the demo used cases of pyamaze and in fact you can implement any of your logic as you mentioned.
      This is the introductory video:
      czcams.com/video/McMU-WuJwG0/video.html

  • @neprositha
    @neprositha Před 2 lety

    possible ways in diagonal means...? how to code?

    • @LearningOrbis
      @LearningOrbis  Před 2 lety

      You mean the agent could move diagonally?
      Sorry, diagonal movement not included 😐

  • @user-oo3nr7tl5t
    @user-oo3nr7tl5t Před 8 měsíci

    how i run the folder from the github

    • @LearningOrbis
      @LearningOrbis  Před 8 měsíci

      I have explained the use here:
      czcams.com/video/McMU-WuJwG0/video.html

  • @oddfeeling7956
    @oddfeeling7956 Před 6 měsíci

    Used this very differently. Created a custom maze like a car park and spawned actors as parked vehicles. Then used BFS to get the closest unused parking location. But the goal point is not being pushed to the bfs_path so i get a trace error saying the ksy cannot be found. Still trouble shooting it tho. Would see what I can do about this as i need to add 3 more vehicles and search the closest parking spot for a total of 4 vehicles . I will also upload code to github and share

  • @user-yx3wv9qm1s
    @user-yx3wv9qm1s Před 6 měsíci

    Does the code in the video give the complete solution?

  • @thanikhurshid7403
    @thanikhurshid7403 Před 2 lety

    BFS gives same path as DFS

    • @LearningOrbis
      @LearningOrbis  Před 2 lety

      If we have multiple paths, the BFS will give the shortest path and DFS might not give that path.
      When there is just one path then obviously both will give the same path.