Skip to content

Add challenge 79: Connected Components (Medium)#210

Open
claude[bot] wants to merge 1 commit intomainfrom
add-challenge-79-connected-components
Open

Add challenge 79: Connected Components (Medium)#210
claude[bot] wants to merge 1 commit intomainfrom
add-challenge-79-connected-components

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 7, 2026

Summary

  • Adds challenge 79: Connected Components (Medium difficulty)
  • Given an undirected graph with N vertices and M edges, label each vertex with the minimum vertex ID in its connected component
  • Teaches: parallel label propagation with atomicMin, iterative convergence detection, work distribution across edges, and graph algorithm parallelization on GPU
  • Not an element-wise operation — requires thinking about algorithm design, atomic operations, and convergence

Test plan

  • All 6 starter files present (.cu, .pytorch.py, .triton.py, .jax.py, .cute.py, .mojo)
  • challenge.html has all 4 sections: problem description, implementation requirements, example, constraints
  • First example matches generate_example_test() values exactly
  • generate_functional_test() covers 10 cases: self-loop, two-vertex graph, isolated vertices, disjoint pairs, line graph, star graph, grid graph, multi-component chains, random sparse graph, complete K4
  • Performance test: N=1,000,000, M=5,000,000 (fits 5x in 16GB VRAM, ~220MB total)
  • pre-commit run --all-files passes
  • Validated with run_challenge.py --action submit: all tests pass on NVIDIA TESLA T4

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants