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()
Best
Henri
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()Best
Henri
--
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 sage-support+unsubscribe@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.
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()
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)
--
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 sage-support...@googlegroups.com.
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 <henri....@gmail.com> 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