def spanning_1d_chain(length):
ret = nx.grid_graph(dim=[int(length + <NUM_LIT:2>)])<EOL>ret.node[<NUM_LIT:0>]['<STR_LIT>'] = <NUM_LIT:0><EOL>ret[<NUM_LIT:0>][<NUM_LIT:1>]['<STR_LIT>'] = <NUM_LIT:0><EOL>ret.node[length + <NUM_LIT:1>]['<STR_LIT>'] = <NUM_LIT:1><EOL>ret[length][length + <NUM_LIT:1>]['<STR_LIT>'] = <NUM_LIT:1><EOL>return ret<EOL>
Generate a linear chain with auxiliary nodes for spanning cluster detection

Parameters
----------

length : int
   Number of nodes in the chain, excluding the auxiliary nodes.

Returns
-------

networkx.Graph
   A linear chain graph with auxiliary nodes for spanning cluster detection

See Also
--------

sample_states : spanning cluster detection