I don't get the right nodes with my networkx code
<p>I am working on my networkx. The question is about :
<em>Consider the network depicted in Figure 19.27; suppose that each node starts with the behavior B, and each node has a threshold of q = 1/2 for switching to behavior A.
1(a) : Now, let e and f form a two-node set S of initial adopters of behavior A. If other nodes follow the threshold rule for choosing behaviors, which nodes will eventually switch to A?</em></p>

<p>This is the Network where it is all about:</p>

<p><img src="https://i.stack.imgur.com/M2H9p.png" alt="network pic"></p>

<p>Now, I know the answer to the question is {'c', 'e', 'f', 'i', 'k'}
But from my code, I only get {'c', 'e', 'f', 'i'}, what is wrong?</p>

<pre><code># Network, dit is de figuur 19.27 van chapter 19 voor vraag 19.8
def create_network():
    H = nx.Graph()
    H.add_edge('e', 'i')
    H.add_edge('e', 'c')
    H.add_edge('c', 'f')
    H.add_edge('i', 'f')
    H.add_edge('f', 'g')
    H.add_edge('i', 'k')
    H.add_edge('k', 'j')
    H.add_edge('g', 'j')
    H.add_edge('g', 'd')
    H.add_edge('j', 'h')
    # Voegt de edges toe zoals die in figuur 19.27 van Chapter 19 afgebeeld is.
    H.add_edge('d', 'h')

    for n in {'e', 'f'}:  # Initial adaptors
        # True betekent dat de node the nieuwe Behavior heeft geadopt
        H.node[n]['new'] = True
    for n in set(H.nodes()) - {'e', 'f'}:  # initial adaptors
        # False betekent dat de node de nieuwe Behavior Reject, dus de node
        # blijft bij de oorspronkelijke behavior
        H.node[n]['new'] = False

    nx.draw(H, with_labels=True)  # De output

    return H

H = create_network()

# Het netwerk dat na een ronde adaption testen een update uitvoert of de
# eventueel toegevoegde nodes na de adaption
def adapted_network(G, a=1, b=1):
    ts = b / (float(b) + a)  # threshold formule van b/(a+b)
    # https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.classes.function.get_node_attributes
    getatt = nx.get_node_attributes(G, 'new')
    nodes = [node for node in G.nodes(True) if node[1]['new'] == False]

    for node, attribute in nodes:
        readyforadopt = len([neighbor for neighbor in G.neighbors(
            node) if getatt[neighbor] == True]) / float(len(G.neighbors(node)))
        # Node zal een behavior adopten als de gegeven ts de ts van de node
        # overstijgt of gelijk is
        if readyforadopt &gt;= ts:
            G.node[node]['new'] = True

    return [node for node in G.nodes(True) if node[1]['new'] == True]

H = create_network()
print [node for node in H.nodes(True) if node[1]['new'] == True]
print adapted_network(H)
</code></pre>