︠e52c2965-f7b5-4bdc-b556-09b128af2506s︠ g=Graph({1:[3,5],2:[4,5],3:[4,5],4:[5],6:[2,4,7]}) g ︡ae8c2435-3800-48a1-a889-bed266924e07︡{"stdout":"Graph on 7 vertices\n"}︡{"done":true}︡ ︠cf3a5b9d-0fba-440d-af6a-5d1ca227b0a4s︠ g.plot() ︡0883e92b-0e52-401a-b7e7-c964df218e9b︡{"file":{"filename":"/projects/f351622c-d261-4717-abee-4c0bfa210e88/.sage/temp/compute4-us/13531/tmp_dP9mSn.svg","show":true,"text":null,"uuid":"fb9ab00f-a91c-40d9-919a-b554ac4cc3a2"},"once":false}︡{"done":true}︡ ︠a4f723a1-c07f-4999-a570-9a7cd44515e2s︠ g.degree_sequence() ︡3ad11b74-e1ef-4c6d-b152-d72d3dec4cb7︡{"stdout":"[4, 4, 3, 3, 3, 2, 1]\n"}︡{"done":true}︡ ︠517d4420-c2d6-4b8b-91b4-300f56b36027s︠ g.diameter() ︡7343c21d-714e-47e7-8c9d-6c3f55d3607c︡{"stdout":"4\n"}︡{"done":true}︡ ︠de9e3a78-8717-434d-89a7-de3b120724eds︠ g.chromatic_number() ︡84222b4d-9e40-463c-a103-1671dbadac37︡{"stdout":"3\n"}︡{"done":true}︡ ︠8d6f7930-d96f-4cf4-9cdb-6ecfb7c51bcds︠ g.adjacency_matrix() ︡1a18555c-d026-4f8b-ba6e-bf8ce73edd2e︡{"stdout":"[0 0 1 0 1 0 0]\n[0 0 0 1 1 1 0]\n[1 0 0 1 1 0 0]\n[0 1 1 0 1 1 0]\n[1 1 1 1 0 0 0]\n[0 1 0 1 0 0 1]\n[0 0 0 0 0 1 0]\n"}︡{"done":true}︡ ︠02bdb230-f5ce-4be5-bdbb-928d16a2833es︠ h=graphs.CubeGraph(3) h.plot(layout="spring") ︡a0cc24e9-c8a7-4aab-b2bb-0b44115a1e1a︡{"file":{"filename":"/projects/f351622c-d261-4717-abee-4c0bfa210e88/.sage/temp/compute4-us/15088/tmp_LyIkvX.svg","show":true,"text":null,"uuid":"8114b155-5944-4d90-8eba-d917b3636738"},"once":false}︡{"done":true}︡ ︠4ec78abe-1c44-4365-bb3e-84752d64283di︠ %html

There are two basic search algorithms for graphs, the breadth-first and depth-first searches. Here, we demonstrate the use of both of them. We start with a small, relatively sparse graph after seeding the random number generator.

︡a3b780b9-4031-44ff-873e-37035fbb26ea︡{"done":true,"html":"

\n There are two basic search algorithms for graphs, the breadth-first and depth-first searches. Here, we demonstrate the use of both of them. We start with a small, relatively sparse graph after seeding the random number generator.\n

"} ︠d4f6ae7e-0056-4276-a984-f014f57b5056s︠ set_random_seed(1000) r=graphs.RandomGNP(20,0.2) r ︡482e0760-c442-4f79-a7dc-c8e6c98307f3︡{"stdout":"RandomGNP(20,0.200000000000000): Graph on 20 vertices\n"}︡{"done":true}︡ ︠a08a116a-6e26-4ff3-9772-47b1e26d4be3io︠ %html

Starting at vertex, 0 in this case, we move in all possible directions along the edges of our graph to reach depth set 1, $D_1$. From each of the vertices in $D_1$, we follow edges to new vertices and the collection of vertices reached in this step if depth set 2, $D_2$. We repeat this process to for as each depth set is non-empty. The result can be treated as an iterable or viewed all at once using list(), as we do here.

︡d4387e58-ff88-4322-8a9c-51c1bf90228a︡{"done":true,"html":"

\n Starting at vertex, 0 in this case, we move in all possible directions along the edges of our graph to reach depth set 1, $D_1$. From each of the vertices in $D_1$, we follow edges to new vertices and the collection of vertices reached in this step if depth set 2, $D_2$. We repeat this process to for as each depth set is non-empty. The result can be treated as an iterable or viewed all at once using list(), as we do here.

"} ︠8a74bc7b-d87f-40e6-bffe-13dc4ff72fees︠ bfs=r.breadth_first_search(0,report_distance="True") list(bfs) ︡385188bd-4821-48aa-8e55-73350231f4b3︡{"stdout":"[(0, 0), (2, 1), (13, 1), (7, 2), (15, 2), (3, 3), (19, 3), (8, 3), (14, 3), (5, 3), (11, 3), (6, 4), (9, 4), (1, 4), (16, 4), (4, 4), (10, 4), (18, 4), (12, 5), (17, 5)]\n"}︡{"done":true}︡ ︠6c210235-fb8e-4367-bda0-92fd313b108ei︠ %html

The maximum depth in a breadth-first search will be a lower bound on the diameter of the graph, which is the length of the longest "shortest path" between all vertices.

︡9f2349ad-e9d0-436a-8cf7-407bf48b7844︡{"done":true,"html":"

\n The maximum depth in a breadth-first search will be a lower bound on the diameter of the graph, which is the length of the longest \"shortest path\" between all vertices.\n

"} ︠a913da9c-5edd-40ff-b43b-f959f41fa5a3s︠ r.diameter() ︡77b9dfd8-4bd9-4f91-bba2-f773d6c256bd︡{"stdout":"5\n"}︡{"done":true}︡ ︠e0e33ee3-9e7d-4458-aeb4-735e5be1731ds︠ r.depth_first_search? ︡01b05d90-9a84-416b-be79-e56298ca785e︡{"code":{"filename":null,"lineno":-1,"mode":"text/x-rst","source":"File: /projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/graphs/generic_graph.py\nSignature : r.depth_first_search(self, start, ignore_direction=False, distance=None, neighbors=None)\nDocstring :\nReturn an iterator over the vertices in a depth-first ordering.\n\nINPUT:\n\n* \"start\" - vertex or list of vertices from which to start the\n traversal\n\n* \"ignore_direction\" - (default False) only applies to directed\n graphs. If True, searches across edges in either direction.\n\n* \"distance\" - Deprecated. Broken, do not use.\n\n* \"neighbors\" - a function giving the neighbors of a vertex. The\n function should take a vertex and return a list of vertices. For\n a graph, \"neighbors\" is by default the \"neighbors()\" function of\n the graph. For a digraph, the \"neighbors\" function defaults to\n the \"neighbor_out_iterator()\" function of the graph.\n\nSee also:\n\n * \"breadth_first_search()\"\n\n * \"breadth_first_search\" -- breadth-first search for fast\n compiled graphs.\n\n * \"depth_first_search\" -- depth-first search for fast compiled\n graphs.\n\nEXAMPLES:\n\n sage: G = Graph( { 0: [1], 1: [2], 2: [3], 3: [4], 4: [0]} )\n sage: list(G.depth_first_search(0))\n [0, 4, 3, 2, 1]\n\nBy default, the edge direction of a digraph is respected, but this\ncan be overridden by the \"ignore_direction\" parameter:\n\n sage: D = DiGraph( { 0: [1,2,3], 1: [4,5], 2: [5], 3: [6], 5: [7], 6: [7], 7: [0]})\n sage: list(D.depth_first_search(0))\n [0, 3, 6, 7, 2, 5, 1, 4]\n sage: list(D.depth_first_search(0, ignore_direction=True))\n [0, 7, 6, 3, 5, 2, 1, 4]\n\nMultiple starting vertices can be specified in a list:\n\n sage: D = DiGraph( { 0: [1,2,3], 1: [4,5], 2: [5], 3: [6], 5: [7], 6: [7], 7: [0]})\n sage: list(D.depth_first_search([0]))\n [0, 3, 6, 7, 2, 5, 1, 4]\n sage: list(D.depth_first_search([0,6]))\n [0, 3, 6, 7, 2, 5, 1, 4]\n\nMore generally, you can specify a \"neighbors\" function. For\nexample, you can traverse the graph backwards by setting\n\"neighbors\" to be the \"neighbors_in()\" function of the graph:\n\n sage: D = digraphs.Path(10)\n sage: D.add_path([22,23,24,5])\n sage: D.add_path([5,33,34,35])\n sage: list(D.depth_first_search(5, neighbors=D.neighbors_in))\n [5, 4, 3, 2, 1, 0, 24, 23, 22]\n sage: list(D.breadth_first_search(5, neighbors=D.neighbors_in))\n [5, 24, 4, 23, 3, 22, 2, 1, 0]\n sage: list(D.depth_first_search(5, neighbors=D.neighbors_out))\n [5, 6, 7, 8, 9, 33, 34, 35]\n sage: list(D.breadth_first_search(5, neighbors=D.neighbors_out))\n [5, 33, 6, 34, 7, 35, 8, 9]"}}︡{"done":true}︡ ︠0e2491cd-3a39-45c3-936d-dc5d17299dbd︠ ︡d104ae4d-b28b-4b95-9514-7ea1b35cbe72︡ ︠e3cd094e-f1ae-4377-95b4-e0844b2bc1d5s︠ dfs=r.depth_first_search(start=0) ︡91765e06-3c2f-423b-8ac3-de5b2019e7e3︡{"done":true}︡ ︠6c0b5e76-1364-4125-9200-2de2be3fe3ef︠ ︡03f34b37-9c20-4497-8218-f3636c1d4b24︡ ︠68eff483-17de-4096-89e2-295c1c4d0d21s︠ for v in dfs: print v ︡eb36a199-3d63-4133-bcb7-74c6ee24cded︡{"stdout":"0\n13\n7\n14\n11\n15\n5\n6\n12\n4\n8\n10\n18\n1\n9\n3\n19\n16\n17\n2\n"}︡{"done":true}︡ ︠ce0c4d4b-079f-4fcf-a09f-94c041bfcce5s︠ r.plot() ︡b916466e-86db-4253-885d-115d3a1d6ac8︡{"file":{"filename":"/projects/f351622c-d261-4717-abee-4c0bfa210e88/.sage/temp/compute4-us/15088/tmp_O1Sutk.svg","show":true,"text":null,"uuid":"4e27e0dc-d4f9-4c58-a8f5-421b302fb7e7"},"once":false}︡{"done":true}︡ ︠6072e61e-e4d1-47f2-8af8-8c4a635d4820︠ ︡3ad92192-453f-477e-bd80-e2ed59a32274︡ ︠1c2e8173-b5ce-43f3-9310-058b960bf59ei︠ %html

How many sequences of n nonnegative integers are graphic?

How many different degree sequences are there for an n vertex undirected graph? Does a degree sequence uniquely determine an undirected graph. For example, is there one graph with four vertices and degree sequence (3,1,1,1)?

︡798d135f-28c8-4a4b-b830-58dfb650183b︡{"done":true,"html":"

\n How many sequences of n nonnegative integers are graphic?\n

How many different degree sequences are there for an n vertex undirected graph? Does a degree sequence uniquely determine an undirected graph. For example, is there one graph with four vertices and degree sequence (3,1,1,1)?

"} ︠92121757-d464-41a1-b5ee-0514230f911fs︠ rg=graphs.RandomGNP(10,0.5) rg.degree_sequence() ︡2ee4cec2-5712-4863-904b-49c9b0e61263︡{"stdout":"[5, 5, 5, 4, 4, 3, 3, 2, 2, 1]\n"}︡{"done":true}︡ ︠17c1cd2c-e162-4637-a71f-ea3375a63ad8s︠ rg.is_eulerian() ︡20774b6e-360d-48af-8112-c5bdbb3a5d85︡{"stdout":"False\n"}︡{"done":true}︡ ︠a237c46b-8004-4fc8-877c-3d67d62f4d5as︠ set_random_seed(33) rg=graphs.RandomGNP(35,0.2) rg.is_connected() ︡75d3f2c0-5aff-4896-a7b0-62f24e39504a︡{"stdout":"True\n"}︡{"done":true}︡ ︠87b2266b-ad22-499d-a622-3a00696c382ds︠ rg.plot() ︡70cad6a9-b0c8-4dbe-a1f9-6d632fe97095︡{"file":{"filename":"/projects/f351622c-d261-4717-abee-4c0bfa210e88/.sage/temp/compute4-us/13531/tmp__Lh57j.svg","show":true,"text":null,"uuid":"080e58d3-2c3a-49b3-b26d-214c3b33a1a7"},"once":false}︡{"done":true}︡ ︠634c34dd-8c48-4411-9894-50b649a69c89s︠ rg.is_hamiltonian() ︡b585dd87-97db-4248-a723-de72d6751510︡{"stdout":"True\n"}︡{"done":true}︡ ︠996ee2e1-0422-46f9-bf1d-8fbfd8f525f8i︠ %md A spanning subgraph is one for which V(H)=V(G) ︡cda16ee3-dbc8-44b9-9879-240ae011e571︡{"done":true,"md":"A spanning subgraph is one for which V(H)=V(G)"} ︠8e005137-a438-4a50-9589-8114b0b84ee7︠ g=Graph({1:[3,4,5],2:[4,5],3:[4,5],6:[2,4]}) g.plot(save_pos=True) ︡592389b1-a89a-46fe-8f69-ededcc0160b2︡{"file":{"filename":"/projects/f351622c-d261-4717-abee-4c0bfa210e88/.sage/temp/compute4-us/24637/tmp_kj2auv.svg","show":true,"text":null,"uuid":"072f3ac6-aa86-4c8e-9043-d821edfcbf82"},"once":false}︡{"html":"
"}︡{"done":true}︡ ︠df123178-b471-42d0-b1c0-f4049a45e94ds︠ posit=g.get_pos() posit ︡2053e2fe-1e93-46cf-95b9-c58098dc2e9f︡{"stdout":"{1: [1.1398183902683194, 0.6323995278931902], 2: [0.7856541282386849, -0.60184354419796], 3: [0.6563870407458304, 0.7114396135611625], 4: [1.2180603090400683, -0.04241945033695333], 5: [0.4220724685685111, 0.16082730175516477], 6: [1.4559346510382543, -0.8604034486746043]}\n"}︡{"done":true}︡ ︠57cd9996-42b2-4865-b96c-ef2a0d5460aes︠ posit_r={1: [1.1398183902683194, 0.6323995278931902], 2: [0.7856541282386849, -0.60184354419796], 3: [0.6563870407458304, 0.7114396135611625], 4: [1.2180603090400683, -0.04241945033695333], 6: [1.4559346510382543, -0.8604034486746043]} ︡0d2412cb-5e06-40b0-a2fe-9f28542b3978︡{"done":true}︡ ︠653a82c5-4ac2-423e-9408-4ad5b0233eacs︠ h1=Graph({1:[3],2:[4],3:[4],6:[2,4]}) p2=h1.show(pos=posit) ︡323c59f3-3d33-4ce0-bcfa-3975f7c4c024︡{"file":{"filename":"/projects/f351622c-d261-4717-abee-4c0bfa210e88/.sage/temp/compute4-us/10764/tmp_4kyu6J.svg","show":true,"text":null,"uuid":"878fd304-387d-4c1f-84b0-868bf2b46066"},"once":false}︡{"html":"
"}︡{"done":true}︡ ︠736392dd-28e9-4cf5-9f70-80d534968edes︠ h2=Graph({1:[3,5],2:[4,5],3:[4],6:[2]}) h2.plot() ︡37943f2a-da3d-431b-907d-66b46fbe6541︡{"file":{"filename":"/projects/f351622c-d261-4717-abee-4c0bfa210e88/.sage/temp/compute4-us/15088/tmp_vViiNS.svg","show":true,"text":null,"uuid":"886efb73-5f24-4259-841b-4ff64450d7fe"},"once":false}︡{"done":true}︡ ︠23621404-7585-4873-a7f5-2517e4cfd073s︠ h3=g.spanning_trees()[9] h3.show(pos=posit) ︡80bc4727-baa9-4e26-85c5-53eadbe89d67︡{"file":{"filename":"/projects/f351622c-d261-4717-abee-4c0bfa210e88/.sage/temp/compute4-us/24637/tmp_pF0Bqp.svg","show":true,"text":null,"uuid":"6630ad03-34c1-42aa-b2d8-82c00d652c3f"},"once":false}︡{"html":"
"}︡{"done":true}︡ ︠cfe0305c-6890-497c-8721-8c93e76cc628s︠ g.spanning_trees() ︡34087a35-f0c6-42ef-898e-fa7f13038aad︡{"stdout":"[Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices, Graph on 6 vertices]\n"}︡{"done":true}︡ ︠ced604f7-7cbf-4afd-983b-5752ee0be541︠ g=Graph({1:[3,4,5],2:[4,5],3:[4,5],6:[2,4]}) p1=g.plot(save_pos=True) posit=g.get_pos() p1a=g.plot(pos=posit) posit_r=posit posit_r.pop(5) print posit_r h1=Graph({1:[3],2:[4],3:[4],6:[2,4]}) p2=h1.plot(pos=posit_r) h2=Graph({1:[3,5],2:[4,5],3:[4],6:[2]}) p3=h2.plot(pos=posit) h3=g.spanning_trees()[9] p4=h3.plot(pos=posit) fig=graphics_array(((p1a,p2),(p3,p4))) fig ︡95e423ee-a69c-429e-af30-f735c2dc02c5︡{"stdout":"[2.036750636271431, -0.4416564025709533]\n"}︡{"stdout":"{1: [2.2499028811170922, 0.4446082077560374], 2: [1.2046076653900806, -0.3894460982436145], 3: [2.4397923296347277, -0.017138018767639592], 4: [1.541880540145284, 0.2585074549460352], 6: [0.7072907912653226, 0.14512485688013455]}\n"}︡{"file":{"filename":"/projects/f351622c-d261-4717-abee-4c0bfa210e88/.sage/temp/compute4-us/10764/tmp_B4w7tI.svg","show":true,"text":null,"uuid":"b4730156-493c-4b82-9b79-26763f1d72ca"},"once":false}︡{"html":"
"}︡{"done":true}︡ ︠ca869a87-97a8-4e14-b9c2-cc31fede10des︠ ︡530c26d7-652a-4dfe-861c-ee462c23f200︡{"code":{"source":"File: /usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/combinat/posets/lattices.py\nSignature : LatticePoset(*args, **kwds)\nDocstring :\nConstruct a lattice from various forms of input data.\n\nINPUT:\n\n* \"data\", \"*args\", \"**options\" -- data and options that will be\n passed down to \"Poset()\" to construct a poset that is also a\n lattice.\n\nOUTPUT:\n\n FiniteLatticePoset -- an instance of \"FiniteLatticePoset\"\n\nSee also: \"Posets\", \"FiniteLatticePosets\", \"JoinSemiLattice()\",\n \"MeetSemiLattice()\"\n\nEXAMPLES:\n\nUsing data that defines a poset:\n\n sage: LatticePoset([[1,2],[3],[3]])\n Finite lattice containing 4 elements\n\n sage: LatticePoset([[1,2],[3],[3]], cover_relations = True)\n Finite lattice containing 4 elements\n\nUsing a previously constructed poset:\n\n sage: P = Poset([[1,2],[3],[3]])\n sage: L = LatticePoset(P); L\n Finite lattice containing 4 elements\n sage: type(L)\n \n\nIf the data is not a lattice, then an error is raised:\n\n sage: elms = [1,2,3,4,5,6,7]\n sage: rels = [[1,2],[3,4],[4,5],[2,5]]\n sage: LatticePoset((elms, rels))\n Traceback (most recent call last):\n ...\n ValueError: Not a lattice.\n\nCreating a facade lattice:\n\n sage: L = LatticePoset([[1,2],[3],[3]], facade = True)\n sage: L.category()\n Join of Category of finite lattice posets and Category of finite enumerated sets and Category of facade sets\n sage: parent(L[0])\n Integer Ring\n sage: TestSuite(L).run(skip = ['_test_an_element']) # is_parent_of is not yet implemented","mode":"text/x-rst","lineno":-1,"filename":null}}︡ ︠304b09fd-324e-4bd8-a1a7-dd8371141739s︠ save? ︡51f9afda-ed21-4069-9d4d-11a26dba212b︡{"code":{"filename":null,"lineno":-1,"mode":"text/x-rst","source":"File: /projects/sage/sage-7.3/src/sage/structure/sage_object.pyx\nSignature : save(obj, filename=None, compress=True, **kwds)\nDocstring :\nSave \"obj\" to the file with name \"filename\", which will have an\n\".sobj\" extension added if it doesn't have one and if \"obj\" doesn't\nhave its own \"save()\" method, like e.g. Python tuples.\n\nFor image objects and the like (which have their own \"save()\"\nmethod), you may have to specify a specific extension, e.g. \".png\",\nif you don't want the object to be saved as a Sage object (or\nlikewise, if \"filename\" could be interpreted as already having some\nextension).\n\nWarning: This will *replace* the contents of the file if it\n already exists.\n\nEXAMPLES:\n\n sage: a = matrix(2, [1,2,3,-5/2])\n sage: objfile = os.path.join(SAGE_TMP, 'test.sobj')\n sage: objfile_short = os.path.join(SAGE_TMP, 'test')\n sage: save(a, objfile)\n sage: load(objfile_short)\n [ 1 2]\n [ 3 -5/2]\n sage: E = EllipticCurve([-1,0])\n sage: P = plot(E)\n sage: save(P, objfile_short) # saves the plot to \"test.sobj\"\n sage: save(P, filename=os.path.join(SAGE_TMP, \"sage.png\"), xmin=-2)\n sage: save(P, os.path.join(SAGE_TMP, \"filename.with.some.wrong.ext\"))\n Traceback (most recent call last):\n ...\n ValueError: allowed file extensions for images are '.eps', '.pdf', '.pgf', '.png', '.ps', '.sobj', '.svg'!\n sage: print(load(objfile))\n Graphics object consisting of 2 graphics primitives\n sage: save(\"A python string\", os.path.join(SAGE_TMP, 'test'))\n sage: load(objfile)\n 'A python string'\n sage: load(objfile_short)\n 'A python string'"}}︡{"done":true}︡ ︠eed8a52c-b755-4259-8dc7-3afd46184bfa︠ H=matrix(ZZ,[[1,0,0,0,1,0,0,0],[0,1,0,0,0,1,0,0], [0,0,1,0,0,0,1,0],[0,0,0,1,0,0,0,1]]) T=matrix(ZZ,[[0,0,1,1],[0,1,1,0],[1,1,0,0],[1,0,0,1]]) L=matrix(ZZ,[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1], [1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) L*(T.transpose())*H ︡a79557d9-2bed-4714-b482-3b7608ba83bc︡{"code":{"filename":null,"lineno":-1,"mode":"text/x-rst","source":"[]"}}︡{"stderr":"Traceback (most recent call last):\n File \"/projects/sage/sage-7.3/local/lib/python2.7/site-packages/smc_sagews/sage_parsing.py\", line 423, in introspect\n O = eval(obj if not preparse else preparse_code(obj), namespace)\n File \"\", line 1, in \nNameError: name 'export' is not defined\n"}︡{"stdout":"[0 0 1 1 0 0 1 1]\n[0 1 1 0 0 1 1 0]\n[1 1 0 0 1 1 0 0]\n[1 0 0 1 1 0 0 1]\n[0 0 1 1 0 0 1 1]\n[0 1 1 0 0 1 1 0]\n[1 1 0 0 1 1 0 0]\n[1 0 0 1 1 0 0 1]"}︡{"stdout":"\n"}︡{"done":true}︡ ︠c1ee6690-dab0-4acb-8e37-813e423b3838s︠ H=matrix(ZZ,[[1,0,0,0,1,0,0,0],[0,1,0,0,0,1,0,0], [0,0,1,0,0,0,1,0],[0,0,0,1,0,0,0,1]]) ︡36589643-c5cb-4a46-a96d-58cbc019aab2︡{"done":true}︡ ︠fd266d6d-efd9-4e0f-abca-98e52666c734s︠ H ︡1b9e8c62-5e92-459a-84c5-b8f52250c812︡{"stdout":"[1 0 0 0 1 0 0 0]\n[0 1 0 0 0 1 0 0]\n[0 0 1 0 0 0 1 0]\n[0 0 0 1 0 0 0 1]\n"}︡{"done":true}︡ ︠cd8dc74f-0179-4da6-b1f1-a91475ad10des︠ L ︡316a7231-f32f-403d-aa24-d01d05b722d0︡{"stdout":"[1 0 0 0]\n[0 1 0 0]\n[0 0 1 0]\n[0 0 0 1]\n[1 0 0 0]\n[0 1 0 0]\n[0 0 1 0]\n[0 0 0 1]\n"}︡{"done":true}︡ ︠6f8ba6c8-709e-42a2-afc2-8fda8801c490s︠ T ︡1190659b-cfc5-4e1c-8794-c66fb86a1256︡{"stdout":"[0 0 1 1]\n[0 1 1 0]\n[1 0 0 1]\n"}︡{"done":true}︡ ︠a2c2a8d8-2ee4-4aca-8262-42e8901c607es︠ L*(T.transpose()) ︡b3d52249-6565-4a53-9c5e-b34e16a1bc6e︡{"stdout":"[0 0 1]\n[0 1 0]\n[1 1 0]\n[1 0 1]\n[0 0 1]\n[0 1 0]\n[1 1 0]\n[1 0 1]\n"}︡{"done":true}︡ ︠d6e47bad-7b7c-4b4e-b65e-bf4aa16bff0es︠ T.transpose()*H ︡90fdf61f-a3fd-4cc0-b25f-9e32aaa478b9︡{"stderr":"Error in lines 1-1\nTraceback (most recent call last):\n File \"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 947, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, in \n File \"sage/structure/element.pyx\", line 2900, in sage.structure.element.Matrix.__mul__ (/projects/sage/sage-6.10/src/build/cythonized/sage/structure/element.c:22510)\n return coercion_model.bin_op(left, right, mul)\n File \"sage/structure/coerce.pyx\", line 1069, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (/projects/sage/sage-6.10/src/build/cythonized/sage/structure/coerce.c:9736)\n raise TypeError(arith_error_message(x,y,op))\nTypeError: unsupported operand parent(s) for '*': 'Full MatrixSpace of 4 by 3 dense matrices over Integer Ring' and 'Full MatrixSpace of 4 by 8 dense matrices over Integer Ring'\n"}︡{"done":true}︡ ︠61e49ca8-3a85-4b7a-a9d3-449543c380c5s︠ C = Matrix(RR,[[5,1,2,1,2],[3,1,-2,0,5],[1,1,3,-1,-1]]) C.echelon_form() ︡65d19ccb-a9e3-484f-bd03-7ea5f84bfab8︡{"stdout":"[ 1.00000000000000 0.000000000000000 0.000000000000000 0.500000000000000 0.500000000000000]\n[ 0.000000000000000 1.00000000000000 0.000000000000000 -1.50000000000000 1.50000000000000]\n[ 0.000000000000000 0.000000000000000 1.00000000000000 4.93432455388958e-17 -1.00000000000000]\n"}︡{"done":true}︡ ︠462a241b-1167-4716-a7d2-94086a35d0eas︠ seq=[5,5,4,3,2,1] ︡d4523f08-023b-422a-8841-7071e2e7fa70︡{"done":true}︡ ︠455f7be7-4845-4be1-9e96-b639ac4f0ad4︠ ︡b575a6d7-a9cc-4171-afbc-20f3fa7bdd20︡ ︠22ac23dc-d218-42ea-b76c-549f9524cff7︠ graphs.DegreeSequence([5,3,2,2,2,2]).show() ︡65033430-926b-4870-86f3-8f4d2fcabae3︡{"file":{"filename":"/projects/f351622c-d261-4717-abee-4c0bfa210e88/.sage/temp/compute4-us/29350/tmp_lTZXTD.svg","show":true,"text":null,"uuid":"d8c2d231-a19d-49a8-ab31-162a639db00c"},"once":false}︡{"done":true}︡ ︠f579a448-0567-4314-b7f8-ccb223fba65es︠ graphs.CubeGraph(3).show(layout="spring",vertex_size=0) ︡1bf957f4-47b3-4f24-ad91-4729c50ab02e︡{"file":{"filename":"/home/user/.sage/temp/project-f351622c-d261-4717-abee-4c0bfa210e88/353/tmp_6H3Quc.svg","show":true,"text":null,"uuid":"b0b330be-fd3c-4a9c-b590-5f1f5c3f8174"},"once":false}︡{"done":true}︡ ︠02f966aa-1578-4c5d-9eed-a84bf2a383f1s︠ g=graphs.CubeGraph(3) ︡e5e53082-841c-4a6d-a473-006216a62ad5︡{"done":true}︡ ︠8cf01942-c746-40f6-ac30-96c726ef8cc9s︠ g.show? ︡0d050342-6915-42e5-bb01-11801a37453f︡{"code":{"filename":null,"lineno":-1,"mode":"text/x-rst","source":"File: /ext/sage/sage-8.1/local/lib/python2.7/site-packages/sage/graphs/generic_graph.py\nSignature : g.show(self, method='matplotlib', **kwds)\nDocstring :\nShows the (di)graph.\n\nINPUT:\n\n* \"method\" -- set to \"\"matplotlib\"\" (default) to display the\n graph using matplotlib, or to \"\"js\"\" to visualize it in a browser\n using d3.js.\n\n* Any other argument supported by the drawing functions:\n\n * \"\"matplotlib\"\" -- see \"GenericGraph.plot\" and\n \"sage.plot.graphics.Graphics.show()\".\n\n * \"\"js\"\" -- see \"gen_html_code()\".\n\nEXAMPLES:\n\n sage: C = graphs.CubeGraph(8)\n sage: P = C.plot(vertex_labels=False, vertex_size=0, graph_border=True)\n sage: P.show() # long time (3s on sage.math, 2011)"}}︡{"done":true}︡ ︠e82f83e2-d031-43d2-83b7-ccdeaf2c71be︠