Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Pohl's law: Nothing is so good that somebody, somewhere, will not hate it.


devel / comp.lang.ada / Re: Dijkstra and graphs

SubjectAuthor
* Dijkstra and graphsBjörn Lundin
`* Re: Dijkstra and graphsDmitry A. Kazakov
 `- Re: Dijkstra and graphsBjörn Lundin

1
Dijkstra and graphs

<sg819f$lj1$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5722&group=comp.lang.ada#5722

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: b.f.lun...@gmail.com (Björn Lundin)
Newsgroups: comp.lang.ada
Subject: Dijkstra and graphs
Date: Thu, 26 Aug 2021 14:26:23 +0200
Organization: A noiseless patient Spider
Lines: 66
Message-ID: <sg819f$lj1$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 26 Aug 2021 12:26:23 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a3c54ae614c70792a8054f76ccc06b60";
logging-data="22113"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+dBo5LRdEfQpbnT4n14ML"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0)
Gecko/20100101 Thunderbird/78.13.0
Cancel-Lock: sha1:Si/lR3mIZDs835fwLJnEPVEnHPQ=
Content-Language: en-US
X-Mozilla-News-Host: snews://news.eternal-september.org:563
 by: Björn Lundin - Thu, 26 Aug 2021 12:26 UTC

Hi,
I'm looking to update myself on graphs a bit while I
have a problem at hand that would benefit from Dijkstra's traveling
salesman problem.

The problem at hand is a large conveyor system at a warehouse.
The PLC will scan a box and tell me "box-id 123 is here, should I go
straight or divert'

I know the final destination of the box. So I'll look it up and say
'turn first right here' and the box diverts to the second lane on the
right. It then keeps going until it is scanned again and the procedure
repeats.

e-------f
| |
a------B-------C-----d
| |
g-------h

Box 1 starts at a - final destination is d
Scanners at B and C
Box 1 scanned at B 'go straight'
Here I'd like to increase weight B->C

Box 2 starts at a - final destination is d
Box 2 scanned at B 'go left' - since B->C has become more expensive
Here I'd like to increase weight B->e

Box 1 scanned at C 'go straight'
Here I'd like to decrease weight B->C

Box 3 starts at a - final destination is d
Box 3 scanned at B 'go straight' - since this is cheapest route again,
now when box 1 has left the area
Here I'd like to increase weight B->C because of box 3

You get the idea.

I have one solution (not handling this congestion) but I think I'd like
to look closer at Dijkstra. It has some advantages I like - like easy to
configure. Current solution will gt messy with hundreds of vertexes.

There is one implementation at
https://rosettacode.org/wiki/Dijkstra%27s_algorithm#Ada

which does basically what I want.

However - I cannot see what to add for me to update the weight in the
Edge array.

This implementation takes the weight between two locations or vertexes.
But this is static.

The more boxes between two locations the less I'd like to use that route.

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

Any hints ?

--
Björn

Re: Dijkstra and graphs

<sg82jh$1421$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5723&group=comp.lang.ada#5723

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.niel.me!aioe.org!Hx95GBhnJb0Xc8StPhH8AA.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Dijkstra and graphs
Date: Thu, 26 Aug 2021 14:48:49 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sg82jh$1421$1@gioia.aioe.org>
References: <sg819f$lj1$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="36929"; posting-host="Hx95GBhnJb0Xc8StPhH8AA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Thu, 26 Aug 2021 12:48 UTC

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

Re: Dijkstra and graphs

<sg87cb$kt$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5725&group=comp.lang.ada#5725

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: b.f.lun...@gmail.com (Björn Lundin)
Newsgroups: comp.lang.ada
Subject: Re: Dijkstra and graphs
Date: Thu, 26 Aug 2021 16:10:19 +0200
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <sg87cb$kt$1@dont-email.me>
References: <sg819f$lj1$1@dont-email.me> <sg82jh$1421$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 26 Aug 2021 14:10:19 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a3c54ae614c70792a8054f76ccc06b60";
logging-data="669"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aYutKyKfAqLeKEZtGkEm9"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0)
Gecko/20100101 Thunderbird/78.13.0
Cancel-Lock: sha1:WYSEQjkoMagG1IDIZvbdas7j+Os=
In-Reply-To: <sg82jh$1421$1@gioia.aioe.org>
Content-Language: sv
 by: Björn Lundin - Thu, 26 Aug 2021 14:10 UTC

Den 2021-08-26 kl. 14:48, skrev Dmitry A. Kazakov:
> On 2021-08-26 14:26, Björn Lundin wrote:
>
>> In other words I'd like to dynamically change the weights.
>
>Though you always can remove the edge and add it
> again with another weight.
>

OK - I'll look into that path

thanks

--
Björn

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor