Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168731
Image: ubuntu2004

Reasons for working in Sage

  • Included Atlas of Graphs (all graphs with at most 7 vertices, as numbered in a standard reference; in the included NetworkX library),
  • graph automorphism, graph isomorphism, and graph generation functionality,
  • Online collaborative interface,
  • Fast code in general,
  • Cython (C-level speed for routines that need it),
  • Freely available (for us and other researchers),
  • Our code could become part of Sage.
g=graphs.PathGraph(10) g.show()
print minrank_bounds(g) # in a future version of Sage: # g.minrank() returns 9
(9, 9)
lower,upper = minrank_bounds(g, all_bounds=True) print "Lower bounds: ", lower print "Upper bounds: ", upper
Lower bounds: {'cut vertex (3)': 9, 'diameter': 9, 'forbidden minrank 2': 3, 'zero forcing': 9, 'rank': 0} Upper bounds: {'zero forcing (tree)': 9, 'clique cover': 9, 'cut vertex (3)': 9, 'order': 9, 'rank': 10}
g=graphs.PetersenGraph() g.show()
minrank_bounds(g)
(5, 6)
lower,upper = minrank_bounds(g, all_bounds=True) print "Lower bounds: ", lower print "Upper bounds: ", upper
Lower bounds: {'diameter': 2, 'forbidden minrank 2': 3, 'zero forcing': 5, 'rank': 0} Upper bounds: {'clique cover': 15, 'not path': 8, 'not outer planar': 7, 'order': 9, 'rank': 10, 'not planar': 6}
g=graphs.DodecahedralGraph() print "%s vertices, %s edges"%(g.order(), g.size()) g.show3d()
20 vertices, 30 edges
# Stereoscopic views too!
lower,upper = minrank_bounds(g, all_bounds=True) print "Lower bounds: ", lower print "Upper bounds: ", upper
Lower bounds: {'diameter': 5, 'forbidden minrank 2': 3, 'zero forcing': 14, 'rank': 0} Upper bounds: {'clique cover': 30, 'not outer planar': 17, 'not path': 18, 'order': 19, 'rank': 20}
g.show()
find_zero_forcing_set(g)
{0, 1, 2, 3, 4, 5}