def detect(self, G):
		"""Detect a single core-periphery pair using the Borgatti-Everett algorithm.
	
		Parameters
		----------
		G : NetworkX graph object
		
		Examples
		--------
		>>> import networkx as nx
		>>> import cpalgorithm as cpa
		>>> G = nx.karate_club_graph()  # load the karate club network. 
		>>> be = cpa.BE()
		>>> be.detect(G)

		"""

		node_pairs, w, node2id, id2node = self._to_edge_list(G)

		cppairs = _cp.detect_be(edges=node_pairs, ws=w, num_of_runs = self.num_runs)
		
		N = len(id2node) 
		self.c_ = dict(zip( [id2node[i] for i in range(N)], cppairs[0].astype(int)))
		self.x_ = dict(zip( [id2node[i] for i in range(N)], cppairs[1]))
		self.Q_ = cppairs[2][0]
		self.qs_ = cppairs[3].tolist()