Skip to content

Latest commit

 

History

History
20 lines (17 loc) · 1.14 KB

File metadata and controls

20 lines (17 loc) · 1.14 KB

Graphs

Intro

  • Uses:
    • Social Networks, Recommendation Engines (Netflix, "people also watched"), Location Mapping, Routing Algorithms, Visual Heirarchy
  • A graph is a collection of nodes and connections between those nodes
  • There is no parent node, all nodes are treated equally

Construction

  1. Vertex - A vertex, also called a “node”, is a data object that can have zero or more adjacent vertices
  2. Edge - An edge is a connection between two nodes.
    1. Weighted - when values are assigned to the edges (think maps and distances)
    2. Unweighted - no weights assigned with the edges
    3. Directed - have a direction in how you can traverse between two vertices along an edge (often repesented with arrows) (Instagram)
    4. Undirected - there is no direction (traversal both ways) associated with an edge (FB friends)
  3. Neighbor - The neighbors of a node are its adjacent nodes, i.e., are connected via an edge.
  4. Degree - The degree of a vertex is the number of edges connected to that vertex.

Resources