Changes between Version 8 and Version 9 of soc/2007/UserFriendlyGraph


Ignore:
Timestamp:
May 17, 2007, 8:57:25 PM (15 years ago)
Author:
Andrew Sutton
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • soc/2007/UserFriendlyGraph

    v8 v9  
    22
    33== New Graph Classes ==
    4 I am currently considering alternative approaches to the implementation of the `undirected_graph` and `directed_graph` classes. One thing is clear - i intend to leverage as much existing code in Boost.Graph as possible, so it's probable that these classes will be implemented in terms of the `adjacency_list<>` class. The irony to this approach is that I am not introducing new classes so much as additional abstractions around an existing class. On the other hand, it does make implementation a breeze.
     4[wiki:soc/2007/UserFriendlyGraphNewClasses This] is a discussion of the `[un]directed_graph` classes.
    55
    6 Since I'm planning on reusing the `adjacency_list<>` for this project, I should point out that its template parameters are in a somewhat strange order. I don't fully understand why the out edge list selector would be first and the edge list selector would be last (even after the vertex, edge and graph properties). I suspect that the edge list was templated as an afterthought and to preserve source code compatibility, it was added to the end of the template parameter list. Still, it's just a little ugly if you actually plan to specialize the class beyond its default types.
    7 
    8 (Jeremy: Yes, the edge list selector was added much later, in response to a user request, and
    9 had to go at the end to preserve backwards compatibility, the blessing and curse that it is!)
    10 
    11 '''Question:''' Should the [un]directed graph classes really allow the override of the underlying collections? If the intent of these classes is to get the users up and running, then perhaps those options could be seen as optimizations rather than algorithm design choices. Since these classes can act as drop-in replacements (and are in fact, implemented in terms of an adjacency list), it should be relatively easy to "upgrade" if the user really needs to change those options. Of course, changing the storage options actually affects properties like iterator and descriptor stability, but that's going to be a gotcha anyways.
    12 
    13 (Jeremy: I don't think it is a good idea to allow the override... user's can go directly to
    14 `adjacency_list` if they want that level of customization. The iterator stability is an important
    15 issue and I'd recommend specifying that the user-friendly graph classes have to preserve
    16 stability.)
    17 
    18 '''Question:''' Should the [un]directed classes implement or provide checks to ensure that graphs are simple or contain no self-loops? How can this be managed? My gut feeling is that a good answer to this question might be a complete redesign of the graph concept structure. For exmaple, graph properties might be encapsulated in a struct of tags containing items like allow directedness, parallel edge support, self-loop support, etc. This is probably something to think about in the long-term.
    19 
    20 (Jeremy: I would not prohibit self-loops unless you found a very good motivation. Otherwise
    21 you're just getting in the user's way.)
    22 
    23 I'm going to use the following abbreviations for template parameters quite frequently:
    24  * VL - The type of the vertex list. The vertex list stores all of the vertices of the graph.
    25  * EL - The type of the edge list. Like the vertex list, this stores all the edges in the graph.
    26  * OEL - The type of the out edge list. Each vertex has a corresponding out edge list (hence the name adjacency list) that stores its outgoing edges.
    27  * VP - The type of the vertex property (either internal or bundled). Each vertex is associated with an instance of this type.
    28  * EP - The type of the edge property (also internal or bundled). Each edge is associated with an instance of this type.
    29  * GP - The type of the graph property. These are "global" to the entire graph.
    30 
    31 Rather than embed all of the design iterations into a single page, I've decided to give each their own page so they can be cleanly separated
    32 from the rest of the work here.
    33  * [wiki:soc/2007/UserFriendlyGraphDesignOne First Design]
    34  * [wiki:soc/2007/UserFriendlyGraphDesignTwo Second Design]
    35  * [wiki:soc/2007/UserFriendlyGraphDesignThree Third Design]
    36 
    37 == Measures and Algorithms ==
    38 I haven't given a lot of thought to these since the semester just ended. However, I am starting to consider various type requirements for the algorithms and have spent some time playing with conceptg++. I did notice however, that there is a ticket already exists for finding cliques within a graph (#693) - even better, with links to source code. It might be worth pointing out, that the Bron and Kerbosch algorithm is written for a Boolean matrix so interpreting it for an adjacency list is a bit of a chore. I haven't actually read the other algorithm yet, hopefully it's promising.
    39 
    40 (Jeremy: btw, there is a matrix-as-graph adaptor in the BGL, and it would be straightforward to
    41 provide a graph-as-matrix adaptor.)
    42 
    43 On a side note, I started codifying the Boost.Graph graph concepts into a concepts header just to see if I could make it work - I haven't succeeded yet. Still, it's a good excercise and makes you think about concept hierarchies, nested requirements and the like. Also, i don't like the keyword `concept_map`. Not the idea itself - the keyword. If I'm not mistaken, this keyword replaces `model` from earlier proposals. Alas...
    44 
    45 (Jeremy: very cool! Yes, the `concept_map` keyword royally sucks. It turned out that `model` was
    46 already used in tons of C++ code, so we'd break that code if we turned `model` into a keyword.)
    47 
    48 Since I've been codigying graph concepts, I should point out that ''!IncidenceGraph'' and ''!EdgeListGraph'' both define `source()` and `target()` methods, so they're a little redundant. I think it would be appropriate to remove those methods from the requirements of ''!EdgeListGraph'' since they don't really have anything to do with the listing or enumerating of edges. Just a thought...
    49 
    50 (Jeremy: actually, `source()` and `target()` are pretty important to that concept. It would be better
    51 to refactor them into a common base concept.)
     6== New Algorithms ==
     7[wiki:soc/2007/UserFriendlyGraphNewAlgorithms This] is a discussion of the several new algorithms (mostly just property computations) of graphs.
    528
    539== Documentation and Other Niceties ==