def build_3_node_line_graph(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>)<EOL>graph.new_edge(<NUM_LIT:2>, <NUM_LIT:3>)<EOL>return graph<EOL>
Builds a 3-node, 2-edge connected line graph for testing.