Graph(7) creates a graph with vertices {0 ..., 6}
HTH,
Nikos
Sent from my iPhone
> On Apr 7, 2018, at 9:16 AM, Henri Girard <[email protected]> wrote:
>
> thanks, I tried david suggestion and it's correct now :
>
> edges = [(1,2), (1,3), (1,4),
> (2,3), (2,4), (2,5), (2, 6),
> (3,4), (3,5), (3,6), (3,7),
> (4,6), (4,7), (5,6), (6,7)]
> Gamma = Graph(edges)
> Gamma.show()
> <lniocoeghomimbcp.png>
>
>
> Meanwhile I made it too with networkx to compare :
>
> import networkx as nx
> import matplotlib.pyplot as plt
> G = nx.Graph()
>
> edges = [(1,2), (1,3), (1,4),
> (2,3), (2,4), (2,5), (2, 6),
> (3,4), (3,5), (3,6), (3,7),
> (4,6), (4,7), (5,6), (6,7)]
> G.add_edges_from(edges)
>
> nx.draw_networkx(G)
>
> limits = plt.axis('off')
>
> plt.show(G)
> <aelkcedhefjgaigh.png>
>
>
>
>> Le 07/04/2018 à 15:09, Jan Groenewald a écrit :
>> Hi
>>
>>> On 7 April 2018 at 14:52, Henri Girard <[email protected]> wrote:
>>> I made this graph (meaning a fano's plane) but I have the zero outside the
>>> graph ?
>>>
>>> I don't understand why ? someone could explain ?
>>>
>>> My adjacency_matrix is 8 but shouldn't be 7 ?
>>>
>>> g=Graph(7)
>>> edges = [(1,2), (1,3), (1,4),
>>> (2,3), (2,4), (2,5), (2, 6),
>>> (3,4), (3,5), (3,6), (3,7),
>>> (4,6), (4,7), (5,6), (6,7)]
>>> g.add_edge(1,2),g.add_edge(1,3),g.add_edge(1,4),g.add_edge(2,3),
>>> g.add_edge(2,4),g.add_edge(2,5),g.add_edge(2,6),g.add_edge(3,4),
>>> g.add_edge(3,5),g.add_edge(3,6),g.add_edge(3,7),g.add_edge(4,6),
>>> g.add_edge(4,7),g.add_edge(5,6),g.add_edge(6,7)
>>> g.show()
>>> g.adjacency_matrix(),g.incidence_matrix()
>>>
>>> <nafecclcfhdoekfh.png>
>>>
>>> Best
>>>
>>
>>
>> Graph? shows
>>
>> 2. "Graph(5)" -- return an edgeless graph on the 5 vertices
>> 0,...,4.
>>
>> 3. "Graph([list_of_vertices,list_of_edges])" -- returns a
>> graph with given vertices/edges.
>>
>> To bypass auto-detection, prefer the more explicit
>> "Graph([V,E],format='vertices_and_edges')".
>>
>> 4. "Graph(list_of_edges)" -- return a graph with a given list
>> of edges (see documentation of "add_edges()").
>>
>> To bypass auto-detection, prefer the more explicit "Graph(L,
>> format='list_of_edges')".
>>
>> 5. "Graph({1:[2,3,4],3:[4]})" -- return a graph by
>> associating to each vertex the list of its neighbors.
>>
>> To bypass auto-detection, prefer the more explicit "Graph(D,
>> format='dict_of_lists')".
>>
>> so it seems correct, and there are alternatives if you prefer 1..8 instead
>> of 0..7.
>>
>> Regards,
>> Jan
>>>
>>
>>
>>
>> --
>> .~.
>> /V\ Jan Groenewald
>> /( )\ www.aims.ac.za
>> ^^-^^
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.