Category "graph-algorithm"

Count nodes within k distance of marked nodes in grid

I am attempting to solve a coding challenge however my solution is not very performant, I'm looking for advice or suggestions on how I can improve my algorithm.

Can we detect cycles in directed graph using Union-Find data structure?

I know that one can detect cycles in direct graphs using DFS and BFS. I want to know whether we can detect cycles in directed graphs using Union-Find or not? I

Double lexicographic sorting of binary (0-1) matrices

I want to sort a binary matrix so that its columns and rows are both in lexicographical order by switching rows and columns. In other words, I need a double-lex

Detecting loops in tree structures (graphs)

I'm writing a library which is configured using a recursive structure. For the sake of this discussion I'm calling these graph structures a "tree" since ther