---
title: "Discussion on \"Union find in Python\" | Hashnode"
description: "Discussion on \"Union find in Python\". Are a and b already connected? If you're adding undirected edges one at a time, union find answers that by comparing two roots.\n1. Follow the parents\nEach node starts in its own group with parent[x] ="
url: "https://hashnode.com/posts/union-find-in-python/6b025ada4b3f4dc3cee485de"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Union find in Python](https://basecase-utkarsh.hashnode.dev/union-find-in-python?utm_source=hashnode&utm_medium=feed)

Are a and b already connected? If you're adding undirected edges one at a time, union find answers that by comparing two roots. 1. Follow the parents Each node starts in its own group with parent\[x\] =

Nov 22 · 2 min read · basecase-utkarsh.hashnode.dev  
Read the article

## Written by

[Utkarsh Shrivastava](https://hashnode.com/@utkarshinobi)

@utkarshinobi · San Francisco, USA

  
[View profile](https://hashnode.com/@utkarshinobi)

Algorithms, AI Engineering, Full Stack Systems

Code got cheap. Being right didn’t. Writing about AI engineering, distributed systems, algorithms, and product.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
