[curry] Re: What speed to expect doing logic on graphs represented by maps

From: Felix Holmgren <felix.holmgren_at_gmail.com>
Date: Tue, 13 Nov 2018 09:11:50 +0100

Hi Jeff,

I can't answer your primary question, but regarding other candidate
languages/systems for your problem I'd recommend you have a look at
ConceptBase. (conceptbase.sourceforge.net) From what you described it
sounds like a good fit.

Cheers
/Felix




On Mon, Nov 12, 2018 at 5:40 PM Jeffrey Brown <jeffbrown.the_at_gmail.com>
wrote:

> I want to write something resembling an editor for a graph database. I'm
> wondering if Curry will be fast enough.
>
> The data defining the graph would resemble the following:
>
> type Address = Int
> data Graph = Graph {
> address :: Map String Address
> content :: Map Address String -- `address` and `content` are inverses
> children :: Map Label (Set Address)
> parents :: Map Label (Set Address) }
>
> I would define rules such as:
>
> descendent :: Graph -> Index -> Index
> descendent g i
> -- If j is i's child, then j is i's descendent.
> | Set.member j $ Map.lookup i $ children g
> = j
> descendent g i
> -- If j is i's descendent and k is j's child, then k is i's descendent.
> | descendent g i j
> & (Set.member k $ Map.lookup k $ children g)
> = k
>
> I'll use hash maps unless their space requirements stop me.
>
> I'm hoping the resulting code will quickly (say, in under a second) answer
> queries over a few million nodes, along the lines of "the descendents of X
> and Y, minus any descendents of Z or W". If an unbounded number of
> generations proves computationally difficult, I would not be bothered by
> needing to impose depth limits, ala "the first two generations of
> descendents of X and Y, minus the first seven generations of descendents of
> Z or W".
>
> The graph would be sparse: with an average number of children well under
> five, and few cycles.
>
> Is this kind of performance a reasonable thing to expect from Curry? If
> so, using which compiler? If not, can you recommend another language?
>
> I know Haskell, and prefer it immensely to any other language. I am
> reluctant to write a full application in a pure logic language like
> Mercury, but I will if need be.
>
>
> --
> Jeff Brown | Jeffrey Benjamin Brown
> Website <https://msu.edu/~brown202/> | Facebook
> <https://www.facebook.com/mejeff.younotjeff> | LinkedIn
> <https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often
> miss messages here) | Github <https://github.com/jeffreybenjaminbrown>
>
> _______________________________________________
> curry mailing list -- curry_at_lists.rwth-aachen.de
> To unsubscribe send an email to curry-leave_at_lists.rwth-aachen.de
> https://lists.rwth-aachen.de/postorius/lists/curry.lists.rwth-aachen.de
>


--
Felix Holmgren / Holmgren Interstellar
tel: +46 704 452 469



_______________________________________________
curry mailing list -- curry_at_lists.rwth-aachen.de
To unsubscribe send an email to curry-leave_at_lists.rwth-aachen.de
https://lists.rwth-aachen.de/postorius/lists/curry.lists.rwth-aachen.de
Received on Mo Nov 19 2018 - 17:42:49 CET

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:14 CEST