Knowledge Guide
HomeDSAGraphs

Types of Graph

Types of Graphs

Graphs can vary based on how their edges behave, whether they carry weights, and how their nodes are connected. Understanding graph types is key to choosing the right algorithm for your problem.

1. Undirected Graph

Example: A friendship network – if Alice is friends with Bob, Bob is also friends with Alice.

Image
Image

2. Directed Graph

Example: Web links – one page may link to another, but not necessarily the reverse.

Image
Image

3. Weighted Graph

Example: A road map where each road has a distance or travel time.

Image
Image

4. Unweighted Graph

Example: A family tree or organizational chart where relationships just "exist" or "don’t".

Image
Image

5. Cyclic Graph

Example: A social network loop where you can return to your starting friend by following friend connections.

Image
Image

6. Acyclic Graph

There are two important cases:

Example of DAG: Task scheduling – task A must happen before task B.

Acyclic Graph
Acyclic Graph

7. Connected Graph

Example: A network where all devices are linked directly or indirectly.

Connected Graph
Connected Graph

8. Disconnected Graph

Example: Two social groups with no connections between them.

Disconnected Graph
Disconnected Graph

9. Strongly Connected Graph

Example: In a city road system, if every one-way street still allows you to reach all other streets and return.

Strongly Connected Graphs
Strongly Connected Graphs
Graph TypeDirectionWeightsCycles AllowedExample
Undirected?OptionalYes/NoFriendship network
Directed?OptionalYes/NoWeb links
Weighted? / ??Yes/NoRoad map
Unweighted? / ??Yes/NoFamily tree
Cyclic? / ?Optional?Group of people forming a circle
Acyclic (Tree/DAG)? / ?Optional?Task scheduling, directory tree
Connected?OptionalYes/NoFully linked network
Disconnected? / ?OptionalYes/NoMultiple separate subgraphs
Strongly Connected?OptionalYes/NoFully reachable city map (one-way)
🤖 Don't fully get this? Learn it with Claude

Stuck on Types of Graph? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🎨 Explain it visually

Build the mental picture, not memorization.

I just read a lesson on **Types of Graph** (DSA) and want to truly understand it. Explain Types of Graph from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🤔 Walk me through it (interactive)

Socratic — adapts to where you're stuck.

Teach me **Types of Graph** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧪 Quiz me & fix my gaps

Active recall exposes what you missed.

Quiz me on **Types of Graph** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧠 Make it stick

Intuition + hook + flashcards for long-term memory.

Help me remember **Types of Graph** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes