def build_2_node_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_edge(<NUM_LIT:1>, <NUM_LIT:2>)<EOL>return graph<EOL>
Builds a 2-node connected graph for testing.