public inbox for ccan@ozlabs.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: "Emilio G. Cota" <cota@braap.org>
Cc: ccan@lists.ozlabs.org
Subject: Re: [PATCH 2/5] aga,agar: Dijkstra's algorithm
Date: Fri, 13 Nov 2015 13:02:35 +1100	[thread overview]
Message-ID: <20151113020235.GL4886@voom.redhat.com> (raw)
In-Reply-To: <20151112215951.GA16207@flamenco>


[-- Attachment #1.1: Type: text/plain, Size: 1116 bytes --]

On Thu, Nov 12, 2015 at 04:59:51PM -0500, Emilio G. Cota wrote:
> On Thu, Nov 12, 2015 at 22:42:45 +1100, David Gibson wrote:
> > This uses the lpq module as the implementation of the priority queue.  That
> > means this implementation is some way behind the theoretical efficiency of
> > Dijkstra's algorithm.  It should be reasonably straightforward to swap out
> > the priority queue for a better one in the future, though.
> 
> Have you considered using the heap module?

The aga module (unlike agar) isn't supposed to allocate memory,
instead using the structures that the caller embeds in their own data
structures.

Unfortunately, that means it's not possible to use a binary heap - at
least not the usual array based implementation.  You could make a link
only based implementation, but it gets so horrible that you might as
well use a better data structure (e.g. a pairing heap) at that point.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

  reply	other threads:[~2015-11-13  4:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 11:42 [PATCH 0/5] aga,agar: Dijkstra's algorithm David Gibson
2015-11-12 11:42 ` [PATCH 1/5] aga,agar: Add edge costs David Gibson
2015-11-12 11:42 ` [PATCH 2/5] aga,agar: Dijkstra's algorithm David Gibson
2015-11-12 21:59   ` Emilio G. Cota
2015-11-13  2:02     ` David Gibson [this message]
2015-11-12 11:42 ` [PATCH 3/5] aga, agar: Non-equal edge costs for parallel test graph David Gibson
2015-11-12 11:42 ` [PATCH 4/5] aga, agar: New shortcut1 sample graph and testcases based on it David Gibson
2015-11-12 11:42 ` [PATCH 5/5] aga, agar: New shortcut2 " David Gibson
2015-11-20  6:21 ` [PATCH 0/5] aga,agar: Dijkstra's algorithm David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151113020235.GL4886@voom.redhat.com \
    --to=david@gibson.dropbear.id.au \
    --cc=ccan@lists.ozlabs.org \
    --cc=cota@braap.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox