Saturday, November 9, 2013

Chapter 3 is done

This chapter is about Graph computation and there are classical algorithms (BFS, DFS, MST). MST is implementing the classical Prim's algo but using Fibonacci heap available in Boost. Here you find the first version of the graph code

4 comments:

  1. The Graph misses the DTOR and it leaks. If you want I can code inspect the rest.

    ReplyDelete
  2. Quick inspection, no idea if this is what you want, if this is the right direction there is still
    something to do

    - between two vertex can exist more than 1 edge ? If not then the code must be improved
    - Graph can inherit from a map and avoid to export via getNodes() the internal structure
    - Constness
    - replaced post increments with pre increment where possible
    - postponed declaration when possible
    - avoid to copy internal map inside graph
    - avoided o user operator[] on internal graph map in order to avoid not intended inserts
    - in hamiltonianCycle the "returnValue" should be returned instead of always true
    - removed not used variables

    You can find new version here

    https://www.dropbox.com/s/clv30zbuyhlkxhb/Graph.zip

    ReplyDelete
  3. Are you going to post the chapter describing these algorithms?

    ReplyDelete