Re: Looking for graph library

2022-10-09 Thread Ricardo Wurmus


David Pirotte  writes:

>> Can you recommend any library for working with graphs (I did not find
>> it in srfi and mailing list). Almost what I need to have in graphviz
>> bindings, but there are no predicate functions and the like.
>
> In addition to the answers from Maxime and Ricardo ... I searched
> because I thought guile has(had) a graphviz binding somewhere, here is
> what I found
>
>   https://reposcope.com/man/en/3guile/gv

Yes, graphviz comes with Guile bindings.  Since they don’t provide a
Guile module you need to define a module like this:

--8<---cut here---start->8---
(define-module (libgv)
  #:export (digraph node edge layout render setv))

(load-extension "libgv_guile" "SWIG_init")
--8<---cut here---end--->8---

These bindings are not very useful for anything beyond visualizing
graphs, though.

-- 
Ricardo



Re: Looking for graph library

2022-10-09 Thread David Pirotte
Hello Ricardo,

> > https://reposcope.com/man/en/3guile/gv  

> Yes, graphviz comes with Guile bindings.  Since they don’t provide a
> Guile module you need to define a module like this:

> --8<---cut here---start->8---
> (define-module (libgv)
>   #:export (digraph node edge layout render setv))
> 
> (load-extension "libgv_guile" "SWIG_init")
> --8<---cut here---end--->8---

Right, but the module I was looking at - but did not try - exports quite
a lot more functionality ...

https://github.com/roelj/graphviz-guile/blob/master/graphviz.scm

David


pgpdbqs_qqqGH.pgp
Description: OpenPGP digital signature


Re: Looking for graph library

2022-10-09 Thread Ricardo Wurmus


David Pirotte  writes:

>> >https://reposcope.com/man/en/3guile/gv  
>
>> Yes, graphviz comes with Guile bindings.  Since they don’t provide a
>> Guile module you need to define a module like this:
>
>> --8<---cut here---start->8---
>> (define-module (libgv)
>>   #:export (digraph node edge layout render setv))
>> 
>> (load-extension "libgv_guile" "SWIG_init")
>> --8<---cut here---end--->8---
>
> Right, but the module I was looking at - but did not try - exports quite
> a lot more functionality ...
>
>   https://github.com/roelj/graphviz-guile/blob/master/graphviz.scm

Yes, this is essentially the same.  My example above just shows the
pattern that needs to be used.  Roel’s module there exports *all* the
procedures.

The point, however, is — as Dmitry wrote earlier — that gv does not
provide any predicates or search algorithms.  gv only provides
constructors and accessors to the graphviz data structure, and the means
to render them.

-- 
Ricardo