Ask Your Question

David Coudert's profile - activity

2024-04-05 08:12:58 +0200 commented answer How to determine there is a k-path between two vertices

Another exponential time solution is to compute all shortest simple paths: def find_k_paths(G, start, end, length):

2024-03-16 09:46:53 +0200 commented question MixedIntegerProgramming with more than 2 indexes

Closing parenthesis are not well placed. This is working p = MixedIntegerLinearProgram(maximization=False, solver="GLPK

2024-03-05 09:15:33 +0200 commented answer Calculate the toughness of a graph

Improving a method that is called many many times makes a difference. However, it would be better to reduce the number o

2024-03-04 11:24:33 +0200 commented answer Calculate the toughness of a graph

To count the number of connected components in G-S, the following method avoids a copy of the graph and is faster. I obt

2024-03-04 11:24:17 +0200 commented answer Calculate the toughness of a graph

To count the number of connected components in G-S, the following method avoids a copy of the graph and is faster. I obt

2024-03-04 11:23:54 +0200 commented answer Calculate the toughness of a graph

To count the number of connected components in G-S, the following method avoids a copy of the graph and is faster. I obt

2024-03-04 11:05:44 +0200 commented answer Calculate the toughness of a graph

You can use the lowerbounds from https://alco.centre-mersenne.org/item/10.5802/alco.197.pdf $t(G) \geq \frac{\mu_n\mu_2}

2024-03-04 11:04:46 +0200 commented answer Calculate the toughness of a graph

You can use the lowerbounds from https://alco.centre-mersenne.org/item/10.5802/alco.197.pdf $t(G) \geq \frac{\mu_n\mu_2}

2024-02-08 19:39:45 +0200 edited answer all_simple_paths generates AttributeError for graphs

Thanks for reporting this issue. With https://github.com/sagemath/sage/pull/37260, we extend the method to work on both

2024-02-08 19:38:58 +0200 answered a question all_simple_paths generates AttributeError for graphs

With https://github.com/sagemath/sage/pull/37260, we extend the method to work on both Graph and DiGraph.

2024-01-07 19:34:38 +0200 commented answer How to find a longest cycle and a longest induced cycle in a graph?

I proposed a more efficient method for both versions in #37028. It implements a integer linear programming formulation u

2024-01-07 19:33:03 +0200 commented answer How to find a longest cycle and a longest induced cycle in a graph?

I proposed a more efficient method for both versions in #37028

2023-11-27 07:07:08 +0200 commented answer Indexes in Linear programming

See also #53887

2023-11-27 07:06:27 +0200 commented answer Indexes in Linear programming

See also #53887

2023-11-27 07:05:27 +0200 commented answer Indexes in Linear programming

See also #53887

2023-09-18 07:08:55 +0200 commented answer Digraphs with Sage

You can at least use graphs.nauty_gentreeg("5 -D4") to enumerate trees of order 5 with degree at most 4 and then filter

2023-09-17 11:20:38 +0200 commented answer Digraphs with Sage

You can at least use graphs.nauty_gentreeg("5 -D4") to enumerate trees of order 5 with degree at most 4 and then filter

2023-09-16 10:29:40 +0200 edited answer Digraphs with Sage

You can use graphs.trees(n) to enumerate undirected trees of order n. sage: for g in graphs.trees(1): ....: print(

2023-09-16 10:28:10 +0200 edited answer Digraphs with Sage

You can use graphs.trees(n) to enumerate undirected trees of order n. sage: for g in graphs.trees(1): ....: print(

2023-09-16 10:25:09 +0200 answered a question Digraphs with Sage

You can use graphs.trees(n) to enumerate undirected trees of order n. sage: for g in graphs.trees(1): ....: print(

2023-08-11 14:12:20 +0200 received badge  Nice Answer (source)
2023-08-10 09:47:47 +0200 answered a question Ticks formatter rounding

This seems a side effect of the default type for real values. sage: a = 0.2; a; type(a) 0.200000000000000 <class 's

2023-07-07 08:32:56 +0200 commented question Some "strange behaviors“ of longest_path

This is a NP-hard problem, so the running time can be very long (see https://en.wikipedia.org/wiki/Longest_path_problem

2023-07-01 12:23:22 +0200 commented question List all connected subgraphs with exactly k vertices

The usefulness of the property and augment parameters is not clear to me. I'm curious to know if some users find these p

2023-07-01 12:16:15 +0200 commented question List all connected subgraphs with exactly k vertices

The documentation of augment also says that: If for any graph G satisfying the property, every subgraph, obtained from G

2023-07-01 12:16:03 +0200 commented question List all connected subgraphs with exactly k vertices

The documentation of augment also says that: If for any graph G satisfying the property, every subgraph, obtained from G

2023-07-01 12:15:46 +0200 commented question List all connected subgraphs with exactly k vertices

The documentation of augment also says that: If for any graph G satisfying the property, every subgraph, obtained from G

2023-07-01 12:15:15 +0200 commented question List all connected subgraphs with exactly k vertices

According the documentation of graphs, when parameter augment='vertices' all graphs up to n=vertices are generated. sag

2023-07-01 12:15:06 +0200 commented question List all connected subgraphs with exactly k vertices

According the documentation of graphs, when parameter augment='vertices' all graphs up to n=vertices are generated. #py

2023-07-01 12:12:41 +0200 commented question List all connected subgraphs with exactly k vertices

The documentation of augment also says that: If for any graph G satisfying the property, every subgraph, obtained from G

2023-07-01 12:12:25 +0200 commented question List all connected subgraphs with exactly k vertices

The documentation of augment also says that: If for any graph G satisfying the property, every subgraph, obtained from G

2023-07-01 12:11:51 +0200 commented question List all connected subgraphs with exactly k vertices

According the documentation of graphs, when parameter augment='vertices' all graphs up to n=vertices are generated. sag

2023-06-29 16:08:46 +0200 commented question List all connected subgraphs with exactly k vertices

I added this idea in the wishlist: issue 35857.

2023-06-29 16:08:13 +0200 commented question List all connected subgraphs with exactly k vertices

I added this idea in the wishlist 35857.

2023-06-29 12:09:45 +0200 commented question List all connected subgraphs with exactly k vertices

It's not obvious to modify the current code of connected_subgraph_iterator to return graphs with exactly k vertices. Mor

2023-06-24 15:39:29 +0200 commented question Rooted Product Graphs on Sagemath

This is now https://github.com/sagemath/sage/pull/35824

2023-06-13 15:08:09 +0200 received badge  Good Answer (source)
2023-06-02 08:06:17 +0200 commented question All faces of a planar graph

Check method faces sage: G = graphs.Grid2dGraph(3, 3) sage: G.faces() [[((0, 0), (0, 1)), ((0, 1), (0, 2)), ((0, 2)

2023-04-30 16:09:13 +0200 commented question Bicyclic Graphs with fixed girth having highest second smallest laplacian eigen value from a collection

The first step is to seach for keyword bicyclic in this forum. You will find 46577/maximum-algebraic-connectivity-from-a

2023-04-30 16:08:15 +0200 commented question Bicyclic Graphs with fixed girth having highest second smallest laplacian eigen value from a collection

The first step is to seach bicyclic in this forum. You will find https://ask.sagemath.org/question/46577/maximum-algebra

2023-04-27 09:09:50 +0200 commented question is there any sagemath code to find a dominating set D with the property that distance between any two vertices in D is atleast 3?

Your problem is not well defined. From the definition of a dominating set, a vertex in D is at distance at most two from

2023-04-27 09:09:27 +0200 commented question is there any sagemath code to find a dominating set D with the property that distance between any two vertices in D is atleast 3?

Your problem is not well defined. From the definition of a dominating set, a vertex in D is at distance at most two from

2023-04-27 09:08:26 +0200 commented question is there any sagemath code to find a dominating set D with the property that distance between any two vertices in D is atleast 3?

Your problem is not well defined. From the definition of a dominating set, a vertex in D is at distance at most two from

2023-04-22 12:12:54 +0200 commented question How is edge coloring satisfied in this code?

Read again constraint p.add_constraint(bv[v,c] + sum(be[e,c] for e in G.edges_incident(v, labels=False)) <= 1). It en

2023-04-15 11:13:34 +0200 commented question What happened to sage.coding.relative_finite_field_extension?

This experimental code has been removed (https://github.com/sagemath/sage/issues/24279) but other standard methods have

2023-04-10 13:58:38 +0200 commented answer A function which sweep the indexes and doesn't stop at the first encounter

The call to p.index(x) returns the first occurence of x in p (so 1) and it takes linear time in the size of the list. s

2023-04-10 13:57:16 +0200 commented answer A function which sweep the indexes and doesn't stop at the first encounter

So for your initial example, you can write sage: [x*1.2^-i for i, x in enumerate(p)] [-100.000000000000, 8.33333333333

2023-04-10 13:56:23 +0200 commented answer A function which sweep the indexes and doesn't stop at the first encounter

The call to p.index(x) returns the first occurence of x in p (so 1) and it takes linear time in the size of the list. s

2023-04-08 14:03:28 +0200 commented answer Is there any code to list all minimal k-distance dominating sets of a simple graph G in sagemath?

This is now Issue 35461.

2023-04-08 11:31:29 +0200 edited answer Is there any code to list all minimal k-distance dominating sets of a simple graph G in sagemath?

You can use method minimal_dominating_sets to list the minimal distance-2 dominating sets on a modified graph H. The mod