nodes: 0, module; 1, function_definition; 2, function_name:compute_savings_list; 3, parameters; 4, block; 5, identifier:self; 6, identifier:graph; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, expression_statement; 11, return_statement; 12, comment:"""Compute Clarke and Wright savings list
  
          A saving list is a matrix containing the saving amount S between i and j
  
          S is calculated by S = d(0,i) + d(0,j) - d(i,j) (CLARKE; WRIGHT, 1964)
          
          Args
          ----
          graph: :networkx:`NetworkX Graph Obj< >`
              A NetworkX graaph is used.
          
          Returns
          -------
          :any:`list` of `Node`
              List of nodes sorted by its savings
          """; 13, assignment; 14, pattern_list; 15, call; 16, comment:# t = (i, j); 17, block; 18, assignment; 19, list_comprehension; 20, identifier:savings_list; 21, dictionary; 22, identifier:i; 23, identifier:j; 24, attribute; 25, argument_list; 26, if_statement; 27, if_statement; 28, expression_statement; 29, identifier:sorted_savings_list; 30, call; 31, identifier:nodes; 32, for_in_clause; 33, identifier:graph; 34, identifier:edges; 35, comparison_operator:repr(i) < repr(j); 36, block; 37, else_clause; 38, boolean_operator; 39, block; 40, assignment; 41, identifier:sorted; 42, argument_list; 43, pattern_list; 44, identifier:sorted_savings_list; 45, call; 46, call; 47, expression_statement; 48, block; 49, comparison_operator:i == graph.depot(); 50, comparison_operator:j == graph.depot(); 51, continue_statement; 52, subscript; 53, binary_operator:graph.distance(graph.depot(), i) + graph.distance(graph.depot(), j) - graph.distance(i, j); 54, call; 55, keyword_argument; 56, keyword_argument; 57, identifier:nodes; 58, identifier:saving; 59, identifier:repr; 60, argument_list; 61, identifier:repr; 62, argument_list; 63, assignment; 64, expression_statement; 65, identifier:i; 66, call; 67, identifier:j; 68, call; 69, identifier:savings_list; 70, identifier:t; 71, binary_operator:graph.distance(graph.depot(), i) + graph.distance(graph.depot(), j); 72, call; 73, identifier:list; 74, argument_list; 75, identifier:key; 76, call; 77, identifier:reverse; 78, True; 79, identifier:i; 80, identifier:j; 81, identifier:t; 82, tuple; 83, assignment; 84, attribute; 85, argument_list; 86, attribute; 87, argument_list; 88, call; 89, call; 90, attribute; 91, argument_list; 92, call; 93, attribute; 94, argument_list; 95, identifier:i; 96, identifier:j; 97, identifier:t; 98, tuple; 99, identifier:graph; 100, identifier:depot; 101, identifier:graph; 102, identifier:depot; 103, attribute; 104, argument_list; 105, attribute; 106, argument_list; 107, identifier:graph; 108, identifier:distance; 109, identifier:i; 110, identifier:j; 111, attribute; 112, argument_list; 113, identifier:operator; 114, identifier:itemgetter; 115, integer:1; 116, identifier:j; 117, identifier:i; 118, identifier:graph; 119, identifier:distance; 120, call; 121, identifier:i; 122, identifier:graph; 123, identifier:distance; 124, call; 125, identifier:j; 126, identifier:savings_list; 127, identifier:items; 128, attribute; 129, argument_list; 130, attribute; 131, argument_list; 132, identifier:graph; 133, identifier:depot; 134, identifier:graph; 135, identifier:depot
code: def compute_savings_list(self, graph):
          """Compute Clarke and Wright savings list
  
          A saving list is a matrix containing the saving amount S between i and j
  
          S is calculated by S = d(0,i) + d(0,j) - d(i,j) (CLARKE; WRIGHT, 1964)
          
          Args
          ----
          graph: :networkx:`NetworkX Graph Obj< >`
              A NetworkX graaph is used.
          
          Returns
          -------
          :any:`list` of `Node`
              List of nodes sorted by its savings
          """
  
          savings_list = {}
  
          for i, j in graph.edges():
              # t = (i, j)
              if repr(i) < repr(j):
                  t = (i, j)
              else:
                  t = (j, i)
  
              if i == graph.depot() or j == graph.depot():
                  continue
  
              savings_list[t] = graph.distance(graph.depot(), i) + graph.distance(graph.depot(), j) - graph.distance(i, j)
  
          sorted_savings_list = sorted(list(savings_list.items()), key=operator.itemgetter(1), reverse=True)
  
          return [nodes for nodes, saving in sorted_savings_list]