From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Mart van de Wege Newsgroups: comp.lang.ada Subject: Re: Simple Components: adding an existing object to a graph Date: Sun, 26 Jan 2020 16:39:42 +0100 Message-ID: <87o8uqi5vl.fsf@gaheris.vdwege.eu> References: <87wo9eikja.fsf@gaheris.vdwege.eu> Mime-Version: 1.0 Content-Type: text/plain X-Trace: individual.net n9rsf3beOsoFzsB2qImhTQZkx/yGbvl8QiFAhaAlRrWyc+OiXq X-Orig-Path: gaheris.vdwege.eu!not-for-mail Cancel-Lock: sha1:t3cdJLQAQdX3DCwN8bsOw9biY1M= sha1:SmGnOFq8ziUejUBbUyjy9pibUNQ= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Xref: reader01.eternal-september.org comp.lang.ada:57953 Date: 2020-01-26T16:39:42+01:00 List-Id: "Jeffrey R. Carter" writes: > On 1/26/20 11:23 AM, Mart van de Wege wrote: >> This one's for Dimitry, probably: I want to create a genealogy of >> persons using his generic directed weighted graph package. > > Since a genealogy is a tree, wouldn't it make more sense to use > Ada.Containers.Multiway_Trees? I looked at that first, but how would you model the fact that a child has 2 parents in a tree? As far as I can see Multiway_Trees is still stuck in the model that every child node can have only one parent. My idea was to link nodes, which can have multiple connections, using the family relationship as a weight (using an enumeration type for the relationships). Regards, Mart -- "We will need a longer wall when the revolution comes." --- AJS, quoting an uncertain source.