Add Dijkstra's algorithm and graphutils module

Review Request #7327 — Created May 21, 2015 and submitted

brennie
Review Board
dvcs
7328
f65ae49...
reviewboard

This patch adds the diffviewer.graphutils module which will contain
general purpose graph algorithms, the first of which being Dijkstra's
shortest path algorithm.

Ran unit tests.

Description From Last Updated

Col: 1 W391 blank line at end of file

reviewbotreviewbot

Can you clarify in here exactly what the input and output formats are supposed to be? I can figure it …

daviddavid

Col: 1 E302 expected 2 blank lines, found 1

reviewbotreviewbot

We should avoid using _ as a variable in any code, since by convention, we're using _ for gettext or …

chipx86chipx86

It might be nicer to have one big assert statement (compare distances against a dict that you create).

daviddavid

Same here.

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/graphutils.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/graphutils.py
    
    
  2. reviewboard/diffviewer/graphutils.py (Diff revision 1)
     
     
    Col: 1
     W391 blank line at end of file
    
  3. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/graphutils.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/graphutils.py
    
    
  2. 
      
david
  1. Unit tests/testing done?

  2. reviewboard/diffviewer/graphutils.py (Diff revision 2)
     
     
     
     

    Can you clarify in here exactly what the input and output formats are supposed to be? I can figure it out from the code, but it would be nice to just read it in the comment.

  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/tests.py
        reviewboard/diffviewer/graphutils.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/tests.py
        reviewboard/diffviewer/graphutils.py
    
    
  2. reviewboard/diffviewer/tests.py (Diff revision 3)
     
     
    Col: 1
     E302 expected 2 blank lines, found 1
    
  3. 
      
brennie
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/tests.py
        reviewboard/diffviewer/graphutils.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/tests.py
        reviewboard/diffviewer/graphutils.py
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/diffviewer/tests.py (Diff revision 4)
     
     
     
     
     
     
     
     
     
     
     

    It might be nicer to have one big assert statement (compare distances against a dict that you create).

  3. reviewboard/diffviewer/tests.py (Diff revision 4)
     
     
     
     
     
     
     
     
     
     

    Same here.

  4. 
      
chipx86
  1. 
      
  2. reviewboard/diffviewer/graphutils.py (Diff revision 4)
     
     

    We should avoid using _ as a variable in any code, since by convention, we're using _ for gettext or gettext_lazy. Maybe unused?

  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/tests.py
        reviewboard/diffviewer/graphutils.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/tests.py
        reviewboard/diffviewer/graphutils.py
    
    
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to dvcs (e736879)
Loading...