d = {0: {1:-1/2,4:-1/2,5:-1/2}, 1: {2:-1/2,6:-1/2}, 2: {3:-1/2,7:-1/2}, 3: {4:-1/2,8:-1/2}, 4: {9:-1/2}, 5: {7:-1/2, 8:-1/2}, 6: {8:-1/2,9:-1/2}, 7: {9:-1/2}}
G = Graph(data=d, weighted=True)
bounds = {0:[0,3], 1:[0,3],2:[0,3],3:[0,3],4:[0,3],5:[0,3],6:[0,3],7:[0,3],8:[0,3],9:[0,3]}
H = G.degree_constrained_subgraph(bounds)
if(H):
H.plot(edge_labels=True).show()
else:
print "No subgraph matches given bounds."