Dijkstar icon indicating copy to clipboard operation
Dijkstar copied to clipboard

Add support for undirected graphs?

Open wylee opened this issue 6 years ago • 1 comments

It's currently possible to create an undirected graph by adding edges from both u to v and v to u for all connected pairs (u, v). This requires a bit of extra space and more effort to set up.

The simplest solution I can think of is to add an undirected flag to Graph. When enabled, (v, u) would be added automatically when (u, v) is added. This would still require extra space but wouldn't require any other changes (e.g., to the shortest path algorithm).

wylee avatar Oct 21 '19 22:10 wylee

This can be closed?

elliotwutingfeng avatar Jun 28 '24 22:06 elliotwutingfeng