<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate(data, iterations=1000, force_strength=5.0, dampening=0.01, max_velocity=2.0, max_distance=50, is_3d=True):
 """Runs a force-directed algorithm on a graph, returning a data structure. Args: iterations: (Optional) Number of FDL iterations to run in coordinate generation force_strength: (Optional) Strength of Coulomb and Hooke forces (edit this to scale the distance between nodes) dampening: (Optional) Multiplier to reduce force applied to nodes max_velocity: (Optional) Maximum distance a node can move in one step max_distance: (Optional) The maximum inter-node distance considered is_3d: (Optional) Generates three-dimensional coordinates Outputs a json-serializable Python object. To visualize, pass the output to """


    edges = [{'source': s, 'target': t} for s, t in data]
    nodes = force_directed_layout.run(edges, iterations, force_strength,
                                      dampening, max_velocity, max_distance,
                                      is_3d)
    return {'edges': edges, 'nodes': nodes}