Skip to content

Conversation

MAVRICK-1
Copy link

@MAVRICK-1 MAVRICK-1 commented Jul 31, 2025

Summary

This PR introduces the foundational structure for the LEMON wrapper module in Graphs.jl, addressing issue #447. This is the first of several small PRs that will incrementally build the complete LEMON wrapper functionality.

What's included

  • Created src/LEMON/LEMON.jl module with basic graph types:
    • AbstractLEMONGraph abstract type
    • LEMONGraph for undirected graphs
    • LEMONDiGraph for directed graphs
  • Implemented minimal required interface methods:
    • nv() - number of vertices
    • ne() - number of edges
    • vertices() - vertex iterator
    • is_directed() - graph directionality check
    • show() - display methods
  • Added basic test suite in test/LEMON/lemon.jl
  • Integrated LEMON module into main Graphs.jl exports

Testing

All tests pass:

julia> include("test/LEMON/lemon.jl")
Test Summary: | Pass  Total  Time
LEMON         |   16     16  0.1s

Example usage

using Graphs, Graphs.LEMON

# Create undirected LEMON graph with 5 vertices
g = LEMONGraph(5)
# Output: {5, 0} undirected LEMON graph

# Create directed LEMON graph
dg = LEMONDiGraph(10)
# Output: {10, 0} directed LEMON graph

nv(g)  # 5
ne(g)  # 0
is_directed(g)  # false
is_directed(dg) # true
image

Next steps

Future PRs will add:

  1. Graph conversion utilities between SimpleGraph and LEMON formats
  2. Complete Graph API implementation (add_vertex!, add_edge!, etc.)
  3. Algorithm dispatch to LEMON implementations
  4. GraphsInterfaceChecker.jl integration

Related to

Checklist

  • Tests pass locally
  • Code follows Julia formatting conventions
  • Module is properly exported
  • Basic documentation included

@MAVRICK-1
Copy link
Author

@Krastanov can you please review this pr

Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this. I do not believe this is a an appropriate way to start this work. This does not have any reference to the actual c++ library "LEMON". And even if it was related to that library, it should probably be done in LEMONGraphs.jl, not in Graphs.jl.

I would suggest investigating LEMONGraphs.jl first and doing as much as possible there, as suggested in the description of the bounty.

@Krastanov Krastanov closed this Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants