NetworkX

Previous topic

networkx.MultiDiGraph.remove_edges_from

Next topic

networkx.MultiDiGraph.add_path

Quick search

networkx.MultiDiGraph.add_star

MultiDiGraph.add_star(nlist, data=None)

Add a star.

The first node in nlist is the middle of the star. It is connected to all other nodes in nlist.

Parameters:

nlist : list

A list of nodes.

data : list or iterable, optional

Data to add to the edges in the path. The length should be one less than len(nlist).

Examples

>>> G=nx.Graph()
>>> G.add_star([0,1,2,3])
>>> G.add_star([10,11,12],data=['a','b'])