code: public IntArrayList bfs(int root, boolean isRootT1, boolean[] marked1, boolean[] marked2) {
          IntArrayList ccorder = new IntArrayList();
          Queue<Integer> qNode = new ArrayDeque<>();
          Queue<Boolean> qIsT1 = new ArrayDeque<>();
          qNode.add(root);
          qIsT1.add(isRootT1);
  
          while (!qNode.isEmpty()) {
              // Process the next node in the queue.
              int parent = qNode.remove();
              boolean isT1 = qIsT1.remove();
  
              if (isT1) {
                  // Visit node only if not marked.
                  if (!marked1[parent]) {
                      log.trace("Visiting node {} of type T1", parent);
                      // For each neighbor...
                      for (int nb = 0; nb < this.numNbsT1(parent); nb++) {
                          int e = this.edgeT1(parent, nb);
                          int child = this.childE(e);
                          if (!marked2[child]) {
                              // If the neighbor is not marked, queue the node and add the edge to
                              // the order.
                              qNode.add(child);
                              qIsT1.add(false);
                              ccorder.add(e);
                          }
                      }
                      // Mark the node as visited.
                      marked1[parent] = true;
                  }
              } else {
                  // Visit node only if not marked.
                  if (!marked2[parent]) {
                      log.trace("Visiting node {} of type T2", parent);
                      // For each neighbor...
                      for (int nb = 0; nb < this.numNbsT2(parent); nb++) {
                          int e = this.edgeT2(parent, nb);
                          int child = this.childE(e);
                          if (!marked1[child]) {
                              // If the neighbor is not marked, queue the node and add the edge to
                              // the order.
                              qNode.add(child);
                              qIsT1.add(true);
                              ccorder.add(e);
                          }
                      }
                      // Mark the node as visited.
                      marked2[parent] = true;
                  }
              }
          }
          return ccorder;
      }
docs: Runs a breadth-first-search starting at the root node.