title: Avoid deepcopy() in Python when changing dictionary
body: <p>I am looking for a solution to avoid deepcopy() in my task using Python.</p>
  
  <p>I am implementing a statistical dependency parser using chu-liu-edmonds algorithm. I have a graph represented as a dictionary with every head node stored as a key with each having a list containing one or more objects of the class arc as the value.</p>
  
  <p>In the cle-algorithm, I need to modify the graph (contract a cycle). That means, that I need to delete arc objects and heads, and add others, while I later need the original graph to expand those contracted cycles. Right now, I achieve this by deepcopying the original graph and pass it to the contract function.</p>
  
  <p>Now I ran my programm with cProfile and found out that everything that has to do with deepcopy is by far the part of the algorithm that takes the most time.</p>
  
  <p>So my question is: Is there any way to avoid/reduce this in my situation?</p>