IMBUE interview question

A coding question in graph theory