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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.157.54.250 with SMTP id s55mr1660456otd.48.1474642453366; Fri, 23 Sep 2016 07:54:13 -0700 (PDT) X-Received: by 10.157.8.10 with SMTP id 10mr652111oty.16.1474642453327; Fri, 23 Sep 2016 07:54:13 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!x192no3673847itb.0!news-out.google.com!b4ni9953iti.0!nntp.google.com!u18no3545121ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 23 Sep 2016 07:54:13 -0700 (PDT) In-Reply-To: <0e690fe0-7ac8-4843-8792-50ae14729bcc@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:2c4:103:6d70:850e:1fe2:78be:4321; posting-account=bfqYCQoAAADhOBV9jx08D2gm5EA72sgj NNTP-Posting-Host: 2601:2c4:103:6d70:850e:1fe2:78be:4321 References: <955937c4-b9f9-4e21-9d22-98382df2f45f@googlegroups.com> <0e690fe0-7ac8-4843-8792-50ae14729bcc@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <846376d4-9fe1-4ffc-ab82-e5e9e9f77d2e@googlegroups.com> Subject: Re: New to Ada need help implementing Warshall's algorithm From: James Brewer Injection-Date: Fri, 23 Sep 2016 14:54:13 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:31862 Date: 2016-09-23T07:54:13-07:00 List-Id: On Thursday, September 22, 2016 at 11:31:53 PM UTC-5, Shark8 wrote: > On Wednesday, September 21, 2016 at 4:05:12 PM UTC-6, James Brewer wrote: > > Hello I hope this is right forum for this question. I have been asked t= o write a program that implements Warshall's algorithm using Ada. The probl= em, I have never written an Ada program and I a limited time frame to put t= his together. > > I have have the IDE installed and am in the process of writing some rud= imentary programs to familiarize myself with the language but I'm afraid th= at I may run out of time.=20 > >=20 > > The input data I have is a series of connections between 7 to 9 entitie= s that would be stored in a file. > >=20 > > examples: A->B A->D C->D=20 > > alice->bob alice->larry bob -> larry > > 1 -> 3 1 -> 5 2 -> 5 > >=20 > > Any help you could offer would be greatly appreciated. > > Thanks >=20 >=20 > This sounds kind of like homework, is it? >=20 > In any case, what you could do is use Ada.Containers to handle the proble= m: > * Create an enumeration for nodes, perhaps Node_01 to Node_10. > * Instantiate Ada.Containers.Indefinite_Vectors with that enumeration as = key and element as string. (This is to associate your input-variables w/ th= e enumeration.) > * Instantiate Ada.Containers.Ordered_Sets with the enumeration; this is t= o represent node-connections. > * Instantiate Ada.Containers.Indefinite_Ordered_Maps with the Set-type fr= om the above as the element and the enumeration as the key.=20 >=20 > The rest is left to you. It is a homework of sorts, but not in the way you'd normally think. The in= structor uses Ada when teaching algorithms for the examples but he expects = you to teach yourself Ada on your own while trying to learn the algorithms.= This is a bit daunting when you don't know what the language can and canno= t do. Thanks for the help, I appreciate it.