Skip to content

Add graph_curve(::Graph) #4452

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

Merged
merged 5 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/oscar_references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,18 @@ @Article{BE23
doi = {10.1090/jag/810}
}

@Article{BE91,
author = {Bayer, Dave and Eisenbud, David},
title = {Graph Curves},
journal = {Advances in Mathematics},
volume = {86},
number = {1},
pages = {1--40},
year = {1991},
month = mar,
doi = {10.1016/0001-8708(91)90034-5}
}

@Misc{BEO23,
author = {Besche, Hans Ulrich and Eick, Bettina and O'Brien, Eamonn},
title = {SmallGrp, The GAP Small Groups Library, Version 1.5.3},
Expand Down
1 change: 1 addition & 0 deletions docs/src/AlgebraicGeometry/Curves/ProjectiveCurves.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ CurrentModule = Oscar
ProjectiveCurve
invert_birational_map
geometric_genus
graph_curve
```
1 change: 1 addition & 0 deletions src/AlgebraicGeometry/AlgebraicGeometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include("ToricVarieties/JToric.jl")
include("Curves/AffinePlaneCurve.jl")
include("Curves/ProjectivePlaneCurve.jl")
include("Curves/ProjectiveCurve.jl")
include("Curves/GraphCurve.jl")
include("Curves/ParametrizationPlaneCurves.jl")
include("Surfaces/K3Auto.jl")
include("Surfaces/AdjunctionProcess/AdjunctionProcess.jl")
Expand Down
51 changes: 51 additions & 0 deletions src/AlgebraicGeometry/Curves/GraphCurve.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@doc raw"""
graph_curve(G::Graph)

Return the graph curve of `G`, i.e., a union of lines whose dual graph is `G`, see [BE91](@cite).

Assumes that `G` is trivalent and 3-connected.

# Examples
```jldoctest
julia> G1 = vertex_edge_graph(simplex(3))
Undirected graph with 4 nodes and the following edges:
(2, 1)(3, 1)(3, 2)(4, 1)(4, 2)(4, 3)

julia> C1 = graph_curve(G1)
Projective curve
in projective 2-space over QQ with coordinates [x1, x2, x3]
defined by ideal (x1^2*x2*x3 - x1*x2^2*x3 + x1*x2*x3^2)

julia> G2 = vertex_edge_graph(cube(3))
Undirected graph with 8 nodes and the following edges:
(2, 1)(3, 1)(4, 2)(4, 3)(5, 1)(6, 2)(6, 5)(7, 3)(7, 5)(8, 4)(8, 6)(8, 7)

julia> C2 = graph_curve(G2)
Projective curve
in projective 4-space over QQ with coordinates [x1, x2, x3, x4, x5]
defined by ideal with 5 generators

Comment on lines +23 to +27
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The automatic suppression of the equations in printing makes the second example lack a bit of 'content'...

If you would like to have it for testing reasons, please put it in the tests instead and test for correctness of the curve. If you consider the information as vital for users, please print at least one of the equations.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I will adjust the docstring accordingly.

```
"""
function graph_curve(G::Graph; check::Bool=true)
@req all(isequal(3),degree(G)) "G is not trivalent"
@req connectivity(G)==3 "G is not three-connected"

R,x = graded_polynomial_ring(QQ, div(nv(G), 2) + 1)
rowOfVariables = matrix(R,[x])

cycleMatrix = kernel(matrix(QQ,signed_incidence_matrix(G)); side=:right)
cycleMatrix = matrix(R,cycleMatrix) # converting to matrix over R for vcat below

vertexIdeals = MPolyIdeal[]
E = collect(edges(G))
for v in 1:n_vertices(G)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be like so? (Not sure if it ever matters... maybe for subgraphs...? Perhaps @lkastner can clarify?)

Suggested change
for v in 1:n_vertices(G)
for v in vertices(G)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fingolfin Because of the following: #4426

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once #4633 is merged, this can (and should) be adapted

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for clarifying

edgesContainingV = findall(edge->(v in edge),E)
cycleMatrix_v = cycleMatrix[edgesContainingV,:]
push!(vertexIdeals,ideal(minors(vcat(cycleMatrix_v,rowOfVariables),3)))
end
graphCurveIdeal = reduce(intersect,vertexIdeals)
graphCurve = projective_curve(graphCurveIdeal; is_radical=true)

return graphCurve
end
1 change: 1 addition & 0 deletions src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ export graded_map
export graded_polynomial_ring
export grading_group
export graph
export graph_curve
export graph_from_adjacency_matrix
export graph_from_edges
export grassmann_pluecker_ideal
Expand Down
Loading