comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Dijkstra and graphs
Date: Thu, 26 Aug 2021 14:48:49 +0200	[thread overview]
Message-ID: <sg82jh$1421$1@gioia.aioe.org> (raw)
In-Reply-To: sg819f$lj1$1@dont-email.me

On 2021-08-26 14:26, Björn Lundin wrote:

> In other words I'd like to dynamically change the weights.

Usually implementations of weighted graphs order outgoing edges 
according to their weights. E.g.

 
http://www.dmitry-kazakov.de/ada/components.htm#Generic_Directed_Weighted_Graph

Because you want to search edges by weights efficiently. So, changing 
weight is not possible. Though you always can remove the edge and add it 
again with another weight.

Alternatively, if you are OK with linear search, you simply take a 
directed graph and add an array of weights indexed by the child number 
to each node.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2021-08-26 12:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 12:26 Dijkstra and graphs Björn Lundin
2021-08-26 12:48 ` Dmitry A. Kazakov [this message]
2021-08-26 14:10   ` Björn Lundin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox