[Haskell-cafe] Haskell implementation of longest path algorithm

Jyotirmoy Bhattacharya jyotirmoy at jyotirmoy.net
Mon Feb 23 05:27:38 UTC 2015


On Sun, Feb 22, 2015 at 11:36 PM, Jyotirmoy Bhattacharya <
jyotirmoy at jyotirmoy.net> wrote:

> On Sun, Feb 22, 2015 at 3:04 PM, Jeremy <voldermort at hotmail.com> wrote:
>
>> Compared to the Nim code
>> [https://github.com/logicchains/LPATHBench/blob/master/nim.nim] for a
>> longest path algorithm, Haskell
>> [https://github.com/logicchains/LPATHBench/blob/master/hs.hs] looks
>> horrendously verbose and ugly, even if you ignore the pragmas and imports.
>>
>> Is this idiomatic Haskell style? Could it be clearer, but has to be
>> written
>> that way for performance - although it still takes 3.7x as long as the Nim
>> version [https://github.com/logicchains/LPATHBench/blob/master/writeup.md
>> ]?
>>
>> A clearer version
> http://lpaste.net/120981
> though this is 2x-3x slower than the Haskell version above.
>
>
> Another version that uses mutable vectors to track the visited nodes and
has almost the same run time as the Haskell version in the LPATHBench
repository:

http://lpaste.net/121012

Regards,
Jyotirmoy Bhattacharya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150223/a142cc48/attachment.html>


More information about the Haskell-Cafe mailing list