Graph Data Structure Intro (inc. adjacency list, adjacency matrix, incidence matrix)

Поделиться
HTML-код
  • Опубликовано: 1 фев 2025

Комментарии • 62

  • @OlivierSuire
    @OlivierSuire 6 лет назад +91

    Graph representation uses nodes "a", "b", "c", and adjacency list uses nodes "1", "2", "3" : Confusing

    • @jankidepala
      @jankidepala 5 лет назад +5

      replay video again...

    • @cenkercanbulut3069
      @cenkercanbulut3069 4 года назад +2

      Everything is clear. Pay more attention I guess. They are different Matrix types and approaches. So, Adjacent matrix is one way to implement and incidence matrix the other.

    • @CST1992
      @CST1992 3 года назад

      @@cenkercanbulut3069 You are talking about approaches 2 and 3 whereas he's talking about approach 1. And yes, it's a bit confusing, but not that much.

  • @ksc8168
    @ksc8168 5 лет назад +41

    I found the adjacency list and the adjacency matrix are so confusing. At 1:27 he says the a-b-c graph turning into Node1: Node2, Node 3; Node 2: Node1; Node3: Node3. How does that happen??
    By the way, at 1:44 shouldn't it be a "{" instead of a "["??

    • @supremoluminary
      @supremoluminary Год назад

      On the adjacency matrix, it should be represented as a two dimensional array.
      The syntax error is not the opening [, it is the closing curly brace.

    • @mayaayaviri1493
      @mayaayaviri1493 Год назад +1

      i found this confusing as well

  • @philippalbrecht9023
    @philippalbrecht9023 6 лет назад +21

    If your examples contain a, b and c why not have the nodes contain these values. That would make this so much more clear...

  • @bogdanlargeanu420
    @bogdanlargeanu420 6 лет назад +5

    I found this really good for understanding graph fast(before an exam). If I may suggest an improvement, it would be to cut out in the video editing the pause between definitions. Thanks for sharing!

  • @APC9906
    @APC9906 6 лет назад +25

    Incidence Matrix
    Directed Graph
    He states:
    -1 = Leaving Node
    +1 = Entering Node
    But the graph seems wrong because the -1 and +1 are switched. Am I the only one who thinks this ?

    • @matexxo4004
      @matexxo4004 6 лет назад +3

      Alberto Perez yeah actually this video has more than a few errors in it. You should get correct info on graphs elsewhere, but it's just an intro anyway.

  • @wepranaga
    @wepranaga 4 года назад

    I'm so happy when he said "here's how to represent them in javascript" 😄
    javascript ftw

  • @k.chriscaldwell4141
    @k.chriscaldwell4141 4 года назад

    Graphs also have the property of scale. Nodes of distances, edges, on, say, a road map, are to scale. The graph of a road map is scaled. Alternatively, a graph of, say, times of various methods of completing a process, are not to scale. Changes of the values of the an edge on a scale graph affect other edges. Not so on a non-scale graph.

  • @wolnirroche1532
    @wolnirroche1532 3 года назад

    Thank you so much for the excellent tutorial Beau, this helped me out a lot!

  • @GiacomoSorbi
    @GiacomoSorbi 3 года назад +2

    Would have been much nicer if the JS examples were actually matching the picture on top, particularly with the A-B-C example, which they were most definitely NOT doing all the time - it ended up being more confusing, for no reason.

  • @mazedesign9804
    @mazedesign9804 6 лет назад +37

    adjancey list was confusing. you used a b c, and then used node1 node2 node3...

    • @mazedesign9804
      @mazedesign9804 6 лет назад +2

      guess all the graphs are like that.... you should make a redo

  • @MartinGarcia-bz1oy
    @MartinGarcia-bz1oy 5 лет назад

    (B)Node 1: Node 2, Node 3
    (A)Node 2: Node 1
    (C)Node 3: Node 3

    • @DavidEspinosa21
      @DavidEspinosa21 4 года назад +2

      I think it's supposed to be
      (B)Node 1: Node 2, Node 3
      (A)Node 2: Node 1
      (C)Node 3: Node 1

  • @sergey9679
    @sergey9679 4 года назад +8

    This is a very confusing explanation.

  • @feehracheel
    @feehracheel 5 лет назад

    An amazing explanation to people who are begging to learn

  • @adetokunboarogbonlo2491
    @adetokunboarogbonlo2491 7 лет назад +3

    Hi Beau, thanks for the video. I think is great.
    Correct me if I'm wrong but it seems the js implementation of the adjacency matrix (2:25) is different from the adjacency matrix beign discussed (2:14).
    I may be worng as I have no experience with graphs and js.

    • @freecodecamp
      @freecodecamp  7 лет назад +4

      Woops! Your right, the ones and zeros were supposed to be in the same places.

    • @adetokunboarogbonlo2491
      @adetokunboarogbonlo2491 7 лет назад

      Thanks, I'm looking forward to the next one.

    • @OlivierSuire
      @OlivierSuire 6 лет назад

      I think it's a mistake, indeed

  • @supremoluminary
    @supremoluminary Год назад

    This is about on par with anything from free code camp. Living up to your reputation.

  • @YuanxiangSong
    @YuanxiangSong Год назад

    The explanation is very clear and easy to understand!

  • @andrewmusholt9327
    @andrewmusholt9327 5 лет назад +1

    AdjMat in second example starts with a "[" and ends with a "}".

  • @farhadanwari
    @farhadanwari 3 года назад

    Thank you for this amazing video.
    We will be more pleased if you make it more clear and understandable.

  • @biggapoww
    @biggapoww 7 лет назад

    Sweet graph I needed this video could you do more on graphs

  • @red17electro
    @red17electro 7 лет назад

    Thanks! It is useful, cuz I am afraid I did not know about incidence matrix.

  • @JeremyIglehart
    @JeremyIglehart 2 года назад +1

    Sigh... So many mistakes in this video. It's difficult enough to be learning/relearning things without having poor examples. I know you guys can do better than this. May I consider reuploading the video with all of your mistakes fixed?

  • @PublicUser2000
    @PublicUser2000 5 лет назад +8

    Absolutely confusing !!!!!!! ... author uses a, b and c and then uses 1, 2 and 3. Moreover the first part of the video is inaccurate as well ....

  • @danielh7678
    @danielh7678 6 лет назад +8

    The JavaScript code for the Adjacency List should be:
    var undirectedG = {
    a: ["b"],
    b: ["a", "c"],
    c: ["b"]
    };
    and
    var undirectedGArr = [
    ["b"],
    ["a", "c"],
    ["b"]
    ];
    In the examples of code that show arrays you also forgot to change the closing bracket to a square bracket instead of a brace. I think you should consider taking down this video and uploading a new one that is correct. It is poor conduct to spread false knowledge. People who are newer to programming might become very frustrated by these examples.

    • @edshav
      @edshav 6 лет назад

      thanks for the code

  • @sergeigarbar1896
    @sergeigarbar1896 3 года назад

    1:25 - why Node3: Node3 ???
    it should be Node3:Node2 !!!
    Node1 - is b, connected a node 2 and c node 3
    node2, wwhich is a, connected to node1, i agree.
    but last line??? or i dont understand it???

  • @jankidepala
    @jankidepala 5 лет назад +3

    4:52 - parenthesis incorrect

  • @sahil8565
    @sahil8565 5 лет назад +1

    Where is his next video on traversal ??

  • @krisjanispetrucena4774
    @krisjanispetrucena4774 6 лет назад

    Thank you i understood everything very clearly :)

  • @vincentlavello3499
    @vincentlavello3499 4 года назад

    at 4:07 he says use -1 for an edge leaving a node and 1 for entering a node. But the diagram is the opposite. So I'm confused now. Going back geekforgeeks

    • @DavidEspinosa21
      @DavidEspinosa21 4 года назад

      Yeah I noticed this too, was looking for a comment to confirm.

  • @petersrule
    @petersrule 7 лет назад

    Beau, why are they ones and zeros? Can it be done with booleans? To me, that makes for better semantic representational value.

    • @BeauCarnes
      @BeauCarnes 7 лет назад +2

      It could be done with booleans but numbers allow you to have weighted edges for some of the types of graphs.

  • @tedrostesfu
    @tedrostesfu 6 лет назад

    Thanks sir!

  • @PortgasDAce-kp7wk
    @PortgasDAce-kp7wk 4 года назад

    This is why you can't trust every video

  • @pHazedwan
    @pHazedwan 7 лет назад

    Beau, what program do you use to record your screen with?

    • @BeauCarnes
      @BeauCarnes 7 лет назад +1

      Quicktime. It came with my mac. I also used Quicktime to record the video of me.

  • @kaankosti1279
    @kaankosti1279 4 года назад

    ı love you so much

  • @jonesbts6393
    @jonesbts6393 3 года назад

    Use your code for good, makes me want to use it for evil. :P

  • @sfruizmiranda
    @sfruizmiranda 4 года назад

    who even uses JavaScript as example code for this?

  • @andrewshatnyy
    @andrewshatnyy 4 года назад

    So damn confusing. Just stick to a,b,c

  • @andrewhudson5826
    @andrewhudson5826 3 года назад

    This video is full of mistakes, don't trust it.

  • @nxt..pradip7678
    @nxt..pradip7678 4 года назад

    Bsdk

  • @wajidrasulmalik8934
    @wajidrasulmalik8934 3 года назад

    What a bad teacher! A person who thinks people will look at the pic of matrix and understand everything. Had that been the case, why are you speaking man? Try to explain things written on the slides.

  • @nowbut178
    @nowbut178 4 года назад

    I can build anything, i don't need stupid algorithm

  • @dragonhunter250utub
    @dragonhunter250utub 7 лет назад +9

    too much facial expressions, not natural.

  • @mrt7512
    @mrt7512 7 лет назад +3

    Feedback: would be great If you could first understand the subject, then explain it. Reading the definition from e.g. Wikipedia isn't useful to anyone. Anyway thanks.

    • @BeauCarnes
      @BeauCarnes 7 лет назад +6

      Is there a specific part where my explanation was unclear? I'd love some specific feedback and I can clarify in my graphs part 2 video. Thanks!