20191016 02:36:10 0500  answered a question  inverse binary string bit by bit You can also use 
20191014 01:51:51 0500  commented answer  Sage stalls during computation are you sure 
20191005 10:41:27 0500  commented question  DiGraph, Latex, and same orientation Have you tried 
20190830 01:37:38 0500  commented answer  StopIteration raised during G.eulerian_circuit() if you still get the error, can you modify your code (the line and post the output so we can do tests on that specific graph. If it has too many edges, you can post instead 
20190805 06:58:03 0500  commented answer  caterpillar graphs in sage Most of the methods are well documented, so please check the documentation of the Random Lobsters generator. The parameters of Of course it's random, so two successive calls give different results. Otherwise, use the method proposed by tmonteil 
20190805 02:54:00 0500  answered a question  caterpillar graphs in sage You can use 
20190714 15:29:42 0500  commented question  Boost implementation of Dijkstra's algorithm If you are looking for the fastest code ever, then for sure go for C/C++ (boost, the backend of networkit, igraph, etc.) or some optimized Java libraries (webgraph,...). But if you want a flexible graph library that can be used by many users with different expectations, that can handle various types of graphs (with loops, multiple edges, weights, etc.), that accepts vertices of any hashable type, etc., and that provides hundreds of algorithms... then Sagemath is a good candidate. 
20190714 07:51:43 0500  commented question  Boost implementation of Dijkstra's algorithm Most of the time is lost in converting the graph from one format to another and checking the input. This is the price to pay for offering users a very generic tool: (im)mutable (di)graphs, various types of vertex/edge labels, etc. Significant speed up improvements can certainly be achieved in these tests and in the graph backend itself. Feel free to contribute if you have a proposal for improvement, help is more than welcome. 
20190713 23:27:30 0500  commented question  Boost implementation of Dijkstra's algorithm The running difference in your experiment between Sage graphs are written in Cython, but we must convert the format to boost graph before calling Dijkstra of boost (same for igraph, and also for BFS, etc.). This has a cost. We could try to speed up this conversion. 
20190713 16:04:45 0500  received badge  ● Commentator 
20190713 16:04:45 0500  commented question  Boost implementation of Dijkstra's algorithm Do the following test: write a pure Python method that takes as input a Sage Graph (or a networkx graph) and a source node. This method will then build On my computer the longest operation is to build list 
20190713 10:13:09 0500  commented question  Boost implementation of Dijkstra's algorithm The reported experiment is unfair: the methods don't take the same parameters as input. To be fair, both methods should take as input a Sage Graph. If you count the time to build You can also use 
20190609 09:13:57 0500  received badge  ● Necromancer (source) 
20190609 07:42:35 0500  received badge  ● Nice Answer (source) 
20190522 04:50:34 0500  answered a question  using cplex as a solver in sage  import error undefined symbol: CPXsetlogfile CPXsetlogfile has been deprecated in cplex 12.8 and removed from cplex 12.9. See ticket https://trac.sagemath.org/ticket/27790 
20190403 02:37:52 0500  answered a question  Bicyclic Graphs having highest second smallest laplacian eigen value from a collection instead of 
20190313 03:44:59 0500  answered a question  Number of neighbors of a set of vertices in a graph You want the vertex boundary of a set of vertices. 
20190313 03:31:22 0500  answered a question  Generating plane triangulations plantri is an optional package that you can install using
You will then be able to use the iterator over connected planar triangulations 
20181127 08:16:48 0500  received badge  ● Good Answer (source) 
20181127 08:16:48 0500  received badge  ● Nice Answer (source) 
20180927 04:10:05 0500  commented answer  Why does this error arise? See for instance This stackoverflow discussion for understanding the use and meaning of Concerning your code, you remove vertices of the graph in the 
20180925 06:26:21 0500  answered a question  Why does this error arise? Consider the following code. It follows the description of your relabeling method (I'm not sure of what you really want to get). I can display the relabeled graph. 
20180924 11:47:00 0500  commented question  Why does this error arise? You remove vertices from the list v, but not from the graph. So you may later add a vertex j to the list s that has already been removed from v. 
20180905 10:48:02 0500  answered a question  How to find the spanning elementary subgraphs of a given graph A perfect matching (if the graph has one) is a spanning elementary subgraph according your definition. You can get all the perfect matchings (only 1 in your graph) using Now if you want all spanning elementary subgraphs, you have to design a specific algorithm. 
20180828 04:51:34 0500  commented question  Why can't I find the spectral radius of a tree? There is a bug in this method for trees. Thank you for reporting the issue. This is now ticket #26148. 
20180415 11:55:14 0500  received badge  ● Supporter (source) 
20180318 05:21:32 0500  answered a question  Graph structure having maximum algebraic connectivity among some given blocks You have two approaches to solve this exercise:

20180304 06:05:25 0500  commented question  Getting all nonbacktracking walks of certain length in isogeny graph Could you please define "nonbacktracking walk". 
20180209 06:28:54 0500  commented question  To find trees having certain properties from a collection of trees on given number of vertices This is good class exercise to learn how to manipulate graphs with SageMath and NetworkX. 
20171107 06:52:13 0500  received badge  ● Nice Answer (source) 
20171015 09:07:22 0500  commented question  Edge color for undirected multiedge graphs This is now ticket #24051 
20170921 03:39:42 0500  received badge  ● Enthusiast 
20170916 13:51:52 0500  received badge  ● Nice Answer (source) 
20170915 00:46:19 0500  answered a question  Line graph of a given graph The vertices of the Then you can either use the method that has already been proposed here, or use the Javascript plotting (it's better to increase the link distance). 
20170901 03:30:38 0500  commented question  plot graphs with graph in vertices Ticket 21918 could help... 
20170821 19:56:47 0500  received badge  ● Enlightened (source) 
20170821 19:56:47 0500  received badge  ● Good Answer (source) 
20170821 11:40:53 0500  received badge  ● Nice Answer (source) 
20170821 11:08:35 0500  answered a question  Changing the weights in a graph You can use the set_edge_label 
20170522 02:09:25 0500  commented question  Why is Sage calling 1 a variable? The error message is 
20170519 07:40:07 0500  answered a question  Iterate over acyclic subdigraphs This is certainly not an easy question and I have no better algorithm in mind. I recommend to use Furthermore, with your code you may generate multiple times the same acyclic orientation. One solution is to keep track of previous sets of edges, but this is certainly not scalable. I'm using type For the example you gave, your code generates 5040 graphs while my code generates only 4055 graphs. 
20170429 05:05:41 0500  commented answer  Random block graph The first proposed method starts building a random tree with m edges and then replaces each edge with a kclique. It is effectively not sufficient to get all possible random block graphs. I have added a new version that starts with a random tree with m vertices, replaces each vertex by a kclique and then connect blocks corresponding to tree edges. This way we can get all possible random block graphs. 
20170429 05:00:36 0500  edited answer  Random block graph Recall that a block graph is a graph in which every biconnected component is a clique. A simple method to generate a connected block graph with m blocks of size k is to start from a random tree with m edges and then replace each edge by a clique of order k: The A call to EDIT: The method below starts with a random tree of order m. Then it creates a graph with one kclique (block) per vertex of the tree. We connect blocks corresponding to end vertices of tree edges. To do so, we select one vertex per block and merge the two selected vertices. We use a disjoint set data structure to keep track of the merge operations and so get a unique identifier per set of merged vertices. 