You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
It's currently possible to create an undirected graph by adding edges from both
u
tov
andv
tou
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 toGraph
. 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).The text was updated successfully, but these errors were encountered: