Practice Problems

Daily Challenge: Paths Around the Walls (1500) Solve it to start a streak

graphs Problems

70 practice problems tagged graphs , from difficulty 1200 to 2300 — solve them in our in-browser judge with instant verdicts. Browse all problems.

Related: matrix-exponentiation bfs union-find shortest-paths scc dp greedy constructive sorting math

ProblemTopics Solvers Acceptance Difficulty
Friend Circles graphs 0 1200
The Largest Circle graphs 0 1200
Is There a Route graphs 0 1200
Wires to Add graphs 0 1300
Fewest Hops bfs graphs 0 1300
Tree or Not graphs trees 0 1300
Any Cycle at All graphs union-find 0 1400
Count the Lakes bfs graphs 0 1400
The Largest Lake bfs graphs 0 1400
Escape the Maze bfs graphs 0 1400
Two Teams bfs graphs 0 1500
Knight's Journey bfs graphs 0 1500
Cheapest Network graphs greedy union-find 0 1500
Counting Routes in a DAG dp graphs 0 1500
Cayley's Forest combinatorics graphs 0 1500
Deadlock Detection graphs 12
52%
1600
Schedule the Courses graphs sorting 0 1600
The Rot Spreads bfs graphs 0 1600
Independent Cycles math graphs union-find 0 1600
Longest Path in a DAG dp graphs 0 1600
Cheapest Route graphs shortest-paths 0 1700
How Many Shortest Routes bfs graphs 0 1700
Nodes on Cycles graphs 0 1700
Strongly Connected Pieces graphs scc 0 1800
Free and Paid Roads bfs graphs 0 1800
Walks of Astronomical Length graphs matrix-exponentiation 0 1800
Where Am I After K Jumps graphs binary-lifting 0 1800
Walks on a Pentagon graphs matrix-exponentiation 0 1800
Walks on K4 graphs matrix-exponentiation 0 1800
Walks on a Path of 6 graphs matrix-exponentiation 0 1800
Walks on a Star graphs matrix-exponentiation 0 1800
Walks on a Cube graphs matrix-exponentiation 0 1800
Closed Walks on Square Cycle graphs matrix-exponentiation 0 1800
Closed Walks on Hexagon graphs matrix-exponentiation 0 1800
Closed Walks on Path of Four graphs matrix-exponentiation 0 1800
Closed Walks on Path of Five graphs matrix-exponentiation 0 1800
Closed Walks on K5 graphs matrix-exponentiation 0 1800
Closed Walks on Wheel W4 graphs matrix-exponentiation 0 1800
Closed Walks on Wheel W5 graphs matrix-exponentiation 0 1800
Closed Walks on Bipartite K33 graphs matrix-exponentiation 0 1800
Closed Walks on Heptagon graphs matrix-exponentiation 0 1800
Closed Walks on Octagon graphs matrix-exponentiation 0 1800
Closed Walks on Path of Seven graphs matrix-exponentiation 0 1800
Closed Walks on 2x3 Grid graphs matrix-exponentiation 0 1800
Closed Walks on Bowtie graphs matrix-exponentiation 0 1800
Closed Walks on Path of Three graphs matrix-exponentiation 0 1800
Closed Walks on Wheel W6 graphs matrix-exponentiation 0 1800
Closed Walks on Star S5 graphs matrix-exponentiation 0 1800
Closed Walks on Triangular Prism graphs matrix-exponentiation 0 1800
Closed Walks on Nonagon graphs matrix-exponentiation 0 1800