def add_bidir_edge(self, from_idx, to_idx, etype_str):
    assert etype_str in self.edge_types
    self.edge_list.append((from_idx, to_idx, self.edge_types[etype_str]))
    if self.add_rev_edge:
      # add reversed edge
      rev_etype_str = 'rev-' + etype_str
      assert rev_etype_str in self.edge_types
      self.edge_list.append((to_idx, from_idx, self.edge_types[rev_etype_str]))