createBridgedRing(ringIds, sourceVertexId) {
    let ringMembers = new Set();
    let vertices = new Set();
    let neighbours = new Set();

    for (var i = 0; i < ringIds.length; i++) {
      let ring = this.getRing(ringIds[i]);
      ring.isPartOfBridged = true;

      for (var j = 0; j < ring.members.length; j++) {
        vertices.add(ring.members[j]);
      }

      for (var j = 0; j < ring.neighbours.length; j++) {
        let id = ring.neighbours[j];

        if (ringIds.indexOf(id) === -1) {
          neighbours.add(ring.neighbours[j]);
        }
      }
    } // A vertex is part of the bridged ring if it only belongs to
    // one of the rings (or to another ring
    // which is not part of the bridged ring).


    let leftovers = new Set();

    for (let id of vertices) {
      let vertex = this.graph.vertices[id];
      let intersection = ArrayHelper.intersection(ringIds, vertex.value.rings);

      if (vertex.value.rings.length === 1 || intersection.length === 1) {
        ringMembers.add(vertex.id);
      } else {
        leftovers.add(vertex.id);
      }
    } // Vertices can also be part of multiple rings and lay on the bridged ring,
    // however, they have to have at least two neighbours that are not part of
    // two rings


    let tmp = Array();
    let insideRing = Array();

    for (let id of leftovers) {
      let vertex = this.graph.vertices[id];
      let onRing = false;

      for (let j = 0; j < vertex.edges.length; j++) {
        if (this.edgeRingCount(vertex.edges[j]) === 1) {
          onRing = true;
        }
      }

      if (onRing) {
        vertex.value.isBridgeNode = true;
        ringMembers.add(vertex.id);
      } else {
        vertex.value.isBridge = true;
        ringMembers.add(vertex.id);
      }
    } // Create the ring


    let ring = new Ring([...ringMembers]);
    this.addRing(ring);
    ring.isBridged = true;
    ring.neighbours = [...neighbours];

    for (var i = 0; i < ringIds.length; i++) {
      ring.rings.push(this.getRing(ringIds[i]).clone());
    }

    for (var i = 0; i < ring.members.length; i++) {
      this.graph.vertices[ring.members[i]].value.bridgedRing = ring.id;
    } // Atoms inside the ring are no longer part of a ring but are now
    // associated with the bridged ring


    for (var i = 0; i < insideRing.length; i++) {
      let vertex = this.graph.vertices[insideRing[i]];
      vertex.value.rings = Array();
    } // Remove former rings from members of the bridged ring and add the bridged ring


    for (let id of ringMembers) {
      let vertex = this.graph.vertices[id];
      vertex.value.rings = ArrayHelper.removeAll(vertex.value.rings, ringIds);
      vertex.value.rings.push(ring.id);
    } // Remove all the ring connections no longer used


    for (var i = 0; i < ringIds.length; i++) {
      for (var j = i + 1; j < ringIds.length; j++) {
        this.removeRingConnectionsBetween(ringIds[i], ringIds[j]);
      }
    } // Update the ring connections and add this ring to the neighbours neighbours


    for (let id of neighbours) {
      let connections = this.getRingConnections(id, ringIds);

      for (var j = 0; j < connections.length; j++) {
        this.getRingConnection(connections[j]).updateOther(ring.id, id);
      }

      this.getRing(id).neighbours.push(ring.id);
    }

    return ring;
  }
Creates a bridged ring.

@param {Number[]} ringIds An array of ids of rings involved in the bridged ring.
@param {Number} sourceVertexId The vertex id to start the bridged ring discovery from.
@returns {Ring} The bridged ring.