[ccan] [PATCH 4/4] agar: Re-entrant Abstract Graph Algorithms

Gianluca Della Vedova gianluca at dellavedova.org
Fri Jul 11 20:18:04 EST 2014


I have two newbie questions:
1. what are the pros of the aga(r) module vs igraph 
(http://igraph.org/c/)?
2. More generally, what is the scope of ccan? In the website it seems 
that ccan is modeled after CPAN, but the latter is mainly central 
hosting site, while ccan seems to organize coherently the development of 
the modules.

I apologize if those questions are off-topic or have already been 
answered somewhere.

-- 
Gianluca Della Vedova
http://gianluca.dellavedova.org
On 09/07/2014 at 13:17, David Gibson wrote:

>On Tue, Jul 08, 2014 at 08:52:37PM +0930, Paul 'Rusty' Russell wrote:
>> David Gibson <david at gibson.dropbear.id.au> writes:
>> > The graph algorithms in the aga module require some node-local storage.
>> > This means that the calling code:
>> >     a) Needs to actually allocate memory per node.  That may or may not
>> >        be natural depending on its internal representation.
>> >     b) Multiple algorithms can't run at once (easily), since they all need
>> >        to use the aga_node structures.

>> > This patch adds a new "agar" module which uses the aga module to provide
>> > versions without those restrictions, by allocating per-node storage itself
>> > for each run, and associating those with the caller's representation of
>> > nodes via a hash table.

>> Bonus points for the cute name :)

>> I've thought about a 'tag' module which would provide dynamic struct
>> fields (ie. allow you to tag arbitrary memory).  This is essentially
>> what you've implemented.
>
>Roughly yes.
>
>One other possibility for this is to allow cmp and hash callbacks,
>rather than hashing a pointer.  That would allow further pushing the
>notion that the caller doesn't have to even instantiate the nodes
>itself, if they can just be deduced on the fly.
>
>But it's clunkier to use, so it's probably not worth it.
>
>> You could almost roll this into ccan/aga if you allowed for callbacks
>> on aga_start and aga_finish?
>
>Hm, maybe.


More information about the ccan mailing list