- text in red
+ text in green
! text in orange
# text in gray
@@ text in purple (and bold)@@
- Two types of graph:
- Undirected graph
- Directed graph
- Degree, Indegree and Outdegree
-
In Undirected graph
- No of nodes connected with the vertex is called degree in case of undirected graph.
-
In Directed graph
- No of incoming nodes in undirected graph is called indegree.
- No of Outgoing nodes in undirected graph is called outdegree.
-
+Total degree of all the nodes in an undirected graph will be equal to the 2 multiplied by total no. of edges, i.e(2xE)
as we know that every edge is contibuting for 2 degrees.
- Path in a graph
- In an undirected graph: Path is the sequence of nodes or vertex such that none of the nodes are repeating or visited twice in the path
- In directed graph: If there is an edge between 1 to 5 then you can go from 1 to 5 but you can't go from 5 to 1.
- Undirected cyclic graph: If there is a cycle in an undirected graph then it is called undirected cyclic graph.
- Undirected Acylic graph: If there is no cycle in an undirected graph then it is called undirected acylic graph.
- Directed cyclic graph: If there is a cycle in a directed graph then that is called directed cyclic graph.
- Directed Acylic graph: If there is no cycle in a directed graph then it is called directed acylic graph, this is commonly known as DAG(will be used many times).
Now the last kind of graph is the weighted graph, all of the above types will be there in the weighted graph also
- Undirected weighted graph
- Undirected weighted cyclic graph
- Undirected weighted acylic graph
- Directed weighted graph
- Directed weighted cyclic graph
- Directed weighted acylic graph