def build_triangle_graph_with_costs(directed=False):
if directed:<EOL><INDENT>graph = DirectedGraph()<EOL><DEDENT>else:<EOL><INDENT>graph = UndirectedGraph()<EOL><DEDENT>graph.new_node()<EOL>graph.new_node()<EOL>graph.new_node()<EOL>graph.new_edge(<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:1>)<EOL>graph.new_edge(<NUM_LIT:2>, <NUM_LIT:3>, <NUM_LIT:2>)<EOL>graph.new_edge(<NUM_LIT:3>, <NUM_LIT:1>, <NUM_LIT:10>)<EOL>return graph<EOL>
Builds a triangle graph with costs for testing.