Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with vertices(::Graph) defined in AlgebraicStatistics #4426

Open
YueRen opened this issue Jan 8, 2025 · 0 comments
Open

Problems with vertices(::Graph) defined in AlgebraicStatistics #4426

YueRen opened this issue Jan 8, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@YueRen
Copy link
Member

YueRen commented Jan 8, 2025

There is a problem with the vertices(::Graph) function in experimental/AlgebraicStatistics/src/GraphicalModels.jl:

function vertices(G::Graph)
  E = [[src(e), dst(e)] for e in edges(G)]
  sort(unique(reduce(vcat, E)))
end

It implicitly assumes that every vertex is connected to an edge, which probably applies to all graphs in algebraic statistics, but need not hold in general.

@bkholler: Would you mind renaming the function with a more appropriate name (e.g., vertices_with_positive_degree)?

Of course, for the sake of consistency, it would be nice to have a general vertices(::Graph) function, but how that function should look like depends on whether vertex sets of polymake graphs need to be numbered 1 to n or whether there be gaps (like {1,2,4}).

@YueRen YueRen added the bug Something isn't working label Jan 8, 2025
@YueRen YueRen assigned YueRen and unassigned YueRen Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant