<｜begin▁of▁sentence｜>### Instruction:
Given a set of colors with their corresponding wavelengths in nanometers, {'red': 665, 'blue': 470, 'green': 550}, perform the following operations using NetworkX's MappedQueue: 1) Remove the 'red' color from the queue, 2) Update the priority of 'green' to be 400 and change its color to 'violet', 3) Add a new color 'indigo' with wavelength 425. Then, retrieve all colors sorted by their wavelengths.
### Response:
import networkx as nx

# Creating a MappedQueue with initial elements and their priorities
colors_nm = {'red': 665, 'blue': 470, 'green': 550}
q = nx.utils.MappedQueue(colors_nm)

# Remove an element
q.remove('red')

# Update the priority of an existing element and change its value
q.update('green', 'violet', 400)

# Push a new element with its priority
q.push('indigo', 425)

# Extract elements from the queue in increasing order of their priorities
sorted_elements = [q.pop().element for i in range(len(q.heap))]
print(sorted_elements)
<|EOT|>
