COIN-OR::LEMON - Graph Library

Opened 16 years ago

Last modified 16 years ago

#190 closed task

Standard maps should be reference maps — at Version 1

Reported by: Peter Kovacs Owned by: Alpar Juttner
Priority: critical Milestone: LEMON 1.1 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description (last modified by Peter Kovacs)

Should we state in the graph structure concepts that node and arc/edge maps must be reference maps for all graph types?

It would make writing a general algorithm easier and more convenient since we would have to use set() functions instead of operator[] only for the "external" map types, and all the "internal" maps, which are created by the algorithm could be used as reference maps. Maybe it could also improve the efficiency in some cases, but it is not clear and wasn't tested.

Change History (1)

comment:1 Changed 16 years ago by Peter Kovacs

Description: modified (diff)
Priority: majorcritical

I checked the graph adaptors and they all conform to this concept, so I see no reason for not adding this restriction to the graph concepts.

What do you think?

If we accept this idea, the following modifications should be made:

  • concepts/graph.h, concepts/digraph.h
    • it should be checked in the concept checking classes
    • it should noted in the documentation of the graph concepts
  • list_graph.h, smart_graph.h, full_graph.h, grid_graph.h, hypercube_graph.h
    • remove the comments saying: "It also has an important extra feature that its maps are real reference maps."
  • algorithm classes that use internal maps
    • check the writing operations of internal maps using set() and modify them to use the reference map syntax if it is simplier or possibly more efficient (e.g. map[i]++ instead of map.set(i, map[i] + 1)).
Note: See TracTickets for help on using tickets.