Skip to content

Commit b9a5da2

Browse files
graphs in dsa layout
1 parent 1da2ecb commit b9a5da2

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

dsa/beginner/06-graphs.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
id: 06-graphs
3+
title: Graphs
4+
sidebar_label: Graphs
5+
tags:
6+
- dsa
7+
- data-structures
8+
- graphs
9+
- beginner
10+
- javascript
11+
- python
12+
- c++
13+
- java
14+
- programming
15+
- tutorial
16+
- typescript
17+
sidebar_position: 6
18+
---
19+
20+
In this tutorial, we will learn about graphs in Data Structures and Algorithms. We will discuss what graphs are, how they are used, and why they are important.
21+
22+
## Graphs in Programming
23+
24+
Graph Data Structure is a collection of nodes connected by edges. It’s used to represent relationships between different entities. Graph algorithms are methods used to manipulate and analyze graphs, solving various problems like finding the shortest path or detecting cycles.
25+
26+
Graph is a non-linear data structure consisting of vertices and edges. The vertices are sometimes also referred to as nodes and the edges are lines or arcs that connect any two nodes in the graph. More formally a Graph is composed of a set of vertices( V ) and a set of edges( E ). The graph is denoted by G(V, E).
27+
28+
## Components of a Graph
29+
30+
- Vertices: Vertices are the fundamental units of the graph. Sometimes, vertices are also known as vertex or nodes. Every node/vertex can be labeled or unlabeled.
31+
- Edges: Edges are drawn or used to connect two nodes of the graph. It can be ordered pair of nodes in a directed graph. Edges can connect any two nodes in any possible way. There are no rules. Sometimes, edges are also known as arcs. Every edge can be labelled/unlabelled.
32+
33+
34+
35+
## Applications
36+
37+
- Graph data structures can be used to represent the interactions between players on a team, such as passes, shots, and tackles. Analyzing these interactions can provide insights into team dynamics and areas for improvement.
38+
- Commonly used to represent social networks, such as networks of friends on social media.
39+
- Graphs can be used to represent the topology of computer networks, such as the connections between routers and switches.
40+
- Graphs are used to represent the connections between different places in a transportation network, such as roads and airports.
41+
- Graphs are used in Neural Networks where vertices represent neurons and edges represent the synapses between them. Neural networks are used to understand how our brain works and how connections change when we learn. The human brain has about 10^11 neurons and close to 10^15 synapses.
42+
43+
## Conclusion
44+
45+
In this tutorial, we have learned about graphs in Data Structures and Algorithms. We have discussed what graphs are, how they are used, and why they are important.

0 commit comments

Comments
 (0)