Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. bfs, dfs, a* & dijkstra algorithms - find the shortest route

bfs, dfs, a* & dijkstra algorithms - find the shortest route

Scheduled Pinned Locked Moved Algorithms
helptutorial
9 Posts 5 Posters 156 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TalespinTales
    wrote on last edited by
    #1

    We got an assignment where we have to find the shortest route between S and G and use the bfs, dfs, a* & dijkstra algorithms. I'm not sure I did the steps correctly, I'd love to know if I made a mistake and where. For example in dijksra, when I got to point T I didn't know exactly what to do, if it was possible to end the search and go straight to G, or as I did - go to D and then to G. Regarding the *A, I'm not at all sure that I did it right.. at least the table of steps.. I would appreciate your help. Pdf: Ex0[^]

    D L J M 4 Replies Last reply
    0
    • T TalespinTales

      We got an assignment where we have to find the shortest route between S and G and use the bfs, dfs, a* & dijkstra algorithms. I'm not sure I did the steps correctly, I'd love to know if I made a mistake and where. For example in dijksra, when I got to point T I didn't know exactly what to do, if it was possible to end the search and go straight to G, or as I did - go to D and then to G. Regarding the *A, I'm not at all sure that I did it right.. at least the table of steps.. I would appreciate your help. Pdf: Ex0[^]

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Help with what? You showed no code, and nobody in their right mind is going to click on your link.

      Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak

      T 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Help with what? You showed no code, and nobody in their right mind is going to click on your link.

        Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak

        T Offline
        T Offline
        TalespinTales
        wrote on last edited by
        #3

        its just a pdf file, scan it if you want to. I'm new here and didn't find a way to upload img Smallpdf.com[^]

        D 1 Reply Last reply
        0
        • T TalespinTales

          its just a pdf file, scan it if you want to. I'm new here and didn't find a way to upload img Smallpdf.com[^]

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Still on a clicking a link. I told you the code shows up in a post here, or nothing gets answered. Posting images is not allowed, for obvious abuse reasons. What on earth is so difficult about copying RELEVANT code from your IDE into the little post window and wrapping it in PRE tags?

          Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak

          T 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Still on a clicking a link. I told you the code shows up in a post here, or nothing gets answered. Posting images is not allowed, for obvious abuse reasons. What on earth is so difficult about copying RELEVANT code from your IDE into the little post window and wrapping it in PRE tags?

            Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak

            T Offline
            T Offline
            TalespinTales
            wrote on last edited by
            #5

            It's not a code, it's a graph where we have to find the shortest route from point to point using an algorithm.

            D 1 Reply Last reply
            0
            • T TalespinTales

              We got an assignment where we have to find the shortest route between S and G and use the bfs, dfs, a* & dijkstra algorithms. I'm not sure I did the steps correctly, I'd love to know if I made a mistake and where. For example in dijksra, when I got to point T I didn't know exactly what to do, if it was possible to end the search and go straight to G, or as I did - go to D and then to G. Regarding the *A, I'm not at all sure that I did it right.. at least the table of steps.. I would appreciate your help. Pdf: Ex0[^]

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              You're, in effect, asking us to confirm the validity of "your steps". That would be the job of whoever gave you the "assignment". As it stands, that would require too much effort on our part ("read my pdf").

              "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

              1 Reply Last reply
              0
              • T TalespinTales

                It's not a code, it's a graph where we have to find the shortest route from point to point using an algorithm.

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Then that's a question for your teacher.

                Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak

                1 Reply Last reply
                0
                • T TalespinTales

                  We got an assignment where we have to find the shortest route between S and G and use the bfs, dfs, a* & dijkstra algorithms. I'm not sure I did the steps correctly, I'd love to know if I made a mistake and where. For example in dijksra, when I got to point T I didn't know exactly what to do, if it was possible to end the search and go straight to G, or as I did - go to D and then to G. Regarding the *A, I'm not at all sure that I did it right.. at least the table of steps.. I would appreciate your help. Pdf: Ex0[^]

                  J Offline
                  J Offline
                  jschell
                  wrote on last edited by
                  #8

                  I suspect strongly that there are multiple sites which specialize in discussions of math. Your question is probably better asked there. You might want to phrase it more carefully with more detail. (But that might just be that it so long that I have looked at stuff like that that I cannot judge the question.)

                  1 Reply Last reply
                  0
                  • T TalespinTales

                    We got an assignment where we have to find the shortest route between S and G and use the bfs, dfs, a* & dijkstra algorithms. I'm not sure I did the steps correctly, I'd love to know if I made a mistake and where. For example in dijksra, when I got to point T I didn't know exactly what to do, if it was possible to end the search and go straight to G, or as I did - go to D and then to G. Regarding the *A, I'm not at all sure that I did it right.. at least the table of steps.. I would appreciate your help. Pdf: Ex0[^]

                    M Offline
                    M Offline
                    Malcolm Arthur McLean
                    wrote on last edited by
                    #9

                    So we know the node S and we know the node G, we've got a bunch of links leading out of S, and we've a bunch of links leading to G. And armed with that information we want to find the shortest path. So one way is exhaustive enumeration of the entire graph starting from S, and following links from. And the other way is exhaustive enumeration of the entire graph starting at G, and following links to. And both of those will work, but require enumeration of the entire graph, ad we want to be a little clever. So what do we do? What we do is push out little bubbles from S and G, one link away, two links away, and so on. And we keep a list of nodes for S and G in the bubbles. And eventually a node in the S bubble turns out to be a node in the G bubble, or vice versa, and you've found a path, and the shortest path for most graphs. And then, knowing a bit about the graph topology, we can refine things a bit to speed up the normal case search. But get the two bubbles system working first, and then come back, and we'll discuss how to refine.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups