in Interview Questions
1,509 views
2 votes
2 votes
1. What is equivalence relation? 2. How can u represent equivalence. relation with a data structure? 3. Which data structure? how efficient? How can u test for. equivalence efficiently?
in Interview Questions
1.5k views

1 comment

no answer :O
0
0

1 Answer

0 votes
0 votes
Can't we use directed graphs for representing equivalence relations?

4 Comments

In a graph representation each element of the set will be a vertex and each equivalent class correspond to a strongly connected component rt?

Usually for interviews questions go like this - they tell us answer and take our feedback too :)
0
0

Again, to make it clear,

1. If we are already given that the input relation is equivalence relation, then the strongly connected component would give the correct partition.. we can find using DFS numbering method - i think it has complexity O(V+E) for adjacency lists, and O(V2) for adjacency matrix, in any case less efficient than the disjoint set DS.

2. but for general case of a relation, this might not be true..
Strongly connected component need not necessarily imply partitions i think..

Take this graph for example..

1
1
yes, I meant the first case..
1
1
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true