···77 I need several kind of labels on the edges
88-----
99A: Use one of the functor implementation provided in Persistent or Imperative.
1010- If for instance you want mutable directed graphs with colored vertices,
1010+ If for instance you want mutable directed graphs with colored vertices,
1111 you may do
12121313 type color = Red | Green | Blue | Yellow
···1616 (to be able to change the color you would use `type t = color ref' instead)
1717==========
1818==========
1919-Q: How to choose between concrete and abstract vertices for my graph
1919+Q: How to choose between concrete and abstract vertices for my graph
2020 implementation?
2121-----
2222A: If you fall into one of the following cases, use abstract vertices:
···32323333 But abstract graphs use integer tags to identify vertices;
3434 this tag is made from the global reference [Blocks.cpt_vertex].
3535- If you need to create new vertices after the unserialisation of an abstract
3636- graph, you have to
3737- - serialize [!Blocks.cpt_vertex]
3838- - call function [Blocks.after_unserialization] after your unserialisation
3939- process.
3535+ There are two related issues.
3636+3737+ 1) If there are abstract vertices in RAM while unmarshalling some others,
3838+ you have to be sure that RAM vertices do not share tags with unmarshalled
3939+ ones (except if you really want that).
4040+4141+ 2) If you need to create new vertices after unserialising an abstract graph,
4242+ you have to:
4343+ - serialize [!Blocks.cpt_vertex];
4444+ - call function [Blocks.after_unserialization] after your unserialisation
4545+ process.
4646+4747+ There is no issue with concrete graph: it may be easier to use them if
4848+ unmarshalling is required.
4049==========
4150==========
4251Q: I need Foobar-Tarjan algorithm and it is not provided
···4453A: Please contribute by sending us the code :-) See next question.
4554==========
4655==========
4747-Q: How can I contribute to this library?
5656+Q: How can I contribute to this library?
4857-----
4949-A: You can contribute either with a graph data structure or with an algorithm
5050- over graphs. For the former, please follow the signatures given in module
5858+A: You can contribute either with a graph data structure or with an algorithm
5959+ over graphs. For the former, please follow the signatures given in module
5160 Sig. For the latter, write your algorithm as a functor, following examples
5261 in modules Path, Flow, Components, etc.
5362==========
···5564Q: Your implementation of algorithm AAA could be greatly improved provided
5665 you add this and this into the graph data structure
5766-----
5858-A: Of course yes. But the idea behind ocamlgraph is to be as generic as
6767+A: Of course yes. But the idea behind ocamlgraph is to be as generic as
5968 possible (any algorithm should be useable on any implementation).
60696170 When the graph data structure provides additional capabilities
6262- (such as marking, etc.) it is possible to provide a more efficient
6363- implementation into some specialized functor. See module Traverse for
7171+ (such as marking, etc.) it is possible to provide a more efficient
7272+ implementation into some specialized functor. See module Traverse for
6473 instance (where DFS and cycle detection are optimized for imperative
6574 graphs equipped with marks)
6675==========
···6877Q: I have a graph implementation with polymorphic types for vertices or edges
6978 and thus I can't apply the algorithms functors
7079-----
7171-A: Here we bump into Ocaml's type system limitations: the number of type
7272- parameters must be know when the functor is written and the simplest
8080+A: Here we bump into Ocaml's type system limitations: the number of type
8181+ parameters must be know when the functor is written and the simplest
7382 choice for us was to assume no type parameter at all. (This is exactly the
7474- same for functors Set.Make or Map.Make from Ocaml standard library.)
8383+ same for functors Set.Make or Map.Make from Ocaml standard library.)
7584 As a (bad) workaround, you can copy the functor body and substitute your
7685 own functions for the functor arguments.
7786==========