Module Expr Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore Call AttributeLoad NameLoad attr body For NameStore Call AttributeLoad NameLoad attr body For NameStore Call AttributeLoad NameLoad attr NameLoad body If CompareEq SubscriptLoad NameLoad Index Num Str body Assign NameStore SubscriptLoad NameLoad Index Num Break For NameStore Call AttributeLoad NameLoad attr NameLoad body If CompareEq SubscriptLoad NameLoad Index Num Str body Assign NameStore SubscriptLoad NameLoad Index Num Break Assign NameStore Num For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore BinOpAdd NameLoad BinOpPow BinOpSub Call NameLoad SubscriptLoad NameLoad Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad Num Assign SubscriptStore AttributeLoad NameLoad attr Index TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assert CompareGt Call NameLoad Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Num Str Return SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A 
A* heuristic for euclidean graphs.
 euclidean N/A object N/A N/A 
    A* heuristic for Euclidean graphs.
    
    This heuristic has three requirements:
        1. All nodes should have the attribute 'position';
        2. The weight of all edges should be the euclidean distance between the nodes it links;
        3. The C{optimize()} method should be called before the heuristic search.
    
    A small example for clarification:
    
    >>> g = graph.graph()
    >>> g.add_nodes(['A','B','C'])
    >>> g.add_node_attribute('A', ('position',(0,0)))
    >>> g.add_node_attribute('B', ('position',(1,1)))
    >>> g.add_node_attribute('C', ('position',(0,2)))
    >>> g.add_edge('A','B', wt=2)
    >>> g.add_edge('B','C', wt=2)
    >>> g.add_edge('A','C', wt=4)
    >>> h = graph.heuristics.euclidean()
    >>> h.optimize(g)
    >>> g.heuristic_search('A', 'C', h)
     __init__ N/A N/A self N/A N/A N/A 
        Initialize the heuristic object.
         N/A N/A self distances N/A N/A optimize N/A N/A self graph N/A N/A N/A 
        Build a dictionary mapping each pair of nodes to a number (the distance between them).
        
        @type  graph: graph
        @param graph: Graph. 
         N/A start N/A N/A graph nodes N/A N/A end N/A N/A graph nodes N/A N/A each N/A N/A graph node_attributes start N/A N/A N/A N/A each N/A 0 position N/A N/A start_attr N/A each N/A 1 N/A N/A each N/A N/A graph node_attributes end N/A N/A N/A N/A each N/A 0 position N/A N/A end_attr N/A each N/A 1 N/A N/A dist 0 N/A i N/A range N/A len start_attr N/A N/A dist N/A dist N/A N/A N/A float N/A start_attr N/A i N/A float N/A end_attr N/A i 2 N/A N/A N/A self distances N/A N/A start end dist N/A __call__ N/A N/A self start end N/A N/A N/A 
        Estimate how far start is from end.
        
        @type  start: node
        @param start: Start node.
        
        @type  end: node
        @param end: End node.
         N/A N/A N/A len N/A list N/A N/A N/A self distances keys 0 You need to optimize this heuristic for your graph before it can be used to estimate. N/A N/A N/A self distances N/A N/A start end N/A N/A