Ask Your Question

Telijas's profile - activity

2025-07-12 14:13:18 +0100 received badge ● Notable Question (source)
2025-07-12 14:13:18 +0100 received badge ● Popular Question (source)
2024-10-11 08:31:54 +0100 received badge ● Nice Question (source)
2024-10-11 00:21:24 +0100 commented question Graphs - Gomory Hu tree - Memory blow up and max recursion depth

Thanks a lot, this is awesome news! You also don't see everyday a memory improvement by a factor of 1000 :)

2024-10-08 16:39:46 +0100 asked a question Graphs - Gomory Hu tree - Memory blow up and max recursion depth

Graphs - Gomory Hu tree - Memory blow up and max recursion depth Hello, I am using the graphs part of Sage and encounte

2024-09-29 02:21:50 +0100 marked best answer Graphs - vertex_connectivity - misleading behavior for parameter k

Hello,

I have an issue in the graph theory library using vertex_connectivity(). In the documentation it is said for the parameter k (https://doc.sagemath.org/html/en/refe... ) “when specified, check if the vertex connectivity of the (di)graph is larger or equal to k.“ So, starting from k=1, k=2, …. it starts with true and then flips to false and stays false. (Right? Given a connected graph).

In this example I get for k=1 false and for k=2 true, which should not be possible.

from sage.all import *
from sage.graphs.connectivity import vertex_connectivity

s3 = graphs.SierpinskiGasketGraph(Integer(3))
print(vertex_connectivity(s3, k=1))
print(vertex_connectivity(s3, k=2))
print(vertex_connectivity(s3))
print("Done")

Resulting in

False
True
2
Done

Repeating the test with the Peterson graph shows correct behavior of vertex_connectivity. Can someone help me? Do I understand the documentation wrong?

OS: Ubuntu 23.10
Sage: 10.4

2024-09-29 02:21:48 +0100 received badge ● Supporter (source)
2024-09-28 17:45:24 +0100 received badge ● Good Question (source)
2024-09-27 08:32:37 +0100 received badge ● Nice Question (source)
2024-09-26 23:09:37 +0100 asked a question Graphs - vertex_connectivity - misleading behavior for parameter k

Graphs - vertex_connectivity - misleading behavior for parameter k Hello, I have an issue in the graph theory library u

2024-09-26 22:45:39 +0100 commented answer Error while computing gomory hu tree of graph using LP

Thanks a lot for the help and effort in simplifying the example.

2024-09-26 22:43:46 +0100 marked best answer Error while computing gomory hu tree of graph using LP

Hello,

I have an issue with the Gomory Hu tree computation and hope that someone can help me. I load a graph and pass it to the gomory hu tree computation function using the algorithm „LP“, after around 10 seconds I get the following error and the computation aborts.

Traceback (most recent call last):
  File ".../treewidth-playground/main.py", line 13, in <module>
    hu = graph.gomory_hu_tree(algorithm="LP")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/.../anaconda3/envs/sage2/lib/python3.11/site-packages/sage/graphs/graph.py", line 8697, in gomory_hu_tree
    g = self._gomory_hu_tree(frozenset(self.vertex_iterator()), algorithm=algorithm)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/.../anaconda3/envs/sage2/lib/python3.11/site-packages/sage/graphs/graph.py", line 8579, in _gomory_hu_tree
    for uu, vv, capacity in edges:
        ^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 3, got 2)

an executable example can be found here under the tag „Sage_question_01“: https://gitlab.com/Telijas/treewidth-...

The applications basically consists of loading the graph and applying the algorithm:

import load.file_loader as file_loader
import processing.process
from sage.all import *

# file_name = "./resources/USA-road-d.NY.gr"
file_name = "./resources/AProVE07-03.gaifman.gr"


graph = file_loader.load(file_name)
print("Vertices found:", graph.order(), "and edges:", graph.size())
print("Start computation of gomory hu")
hu = graph.gomory_hu_tree(algorithm="LP")
print("Done computation of gomory hu")
print("Done")
2024-09-26 22:43:46 +0100 received badge ● Scholar (source)
2024-09-25 23:04:58 +0100 received badge ● Student (source)
2024-09-25 19:37:54 +0100 asked a question Error while computing gomory hu tree of graph using LP

Error while computing gomory hu tree of graph using LP Hello, I have an issue with the Gomory Hu tree computation and h