Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Constructors for 2.0

オープン
#34 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
julia
領域
data

調査の方向性

まず、列挙されている SimpleGraph のコンストラクタと、提案されている Graph および MultiGraph のシグネチャを確認します。2.0 API で頂点コレクション、隣接行列、エッジリスト、ジェネレータ、マルチグラフをどのように表現すべきかを比較します。一貫したコンストラクタ設計について合意に達することが完了の条件です。この issue は実装タスクではなく、議論のスレッドです。

索引モデルが issue の本文から書いたものです。

説明

question

Here is a thread for discussing the constructors for Graphs 2.0

Current constructors

Constructors for SimpleGraph

  • SimpleGraph{T}() : empty graph
  • SimpleGraph{T}(nv::Integer) : graph with no edges
  • SimpleGraph{T}(nv::Integer, ne::Integer) : random graph (erdos-renyi)
  • SimpleGraph(::Type{T}) : empty graph
  • SimpleGraph(nv::Integer, ne::Integer, edgestream::Channel) : add edges from the stream until stream end or we reach ne edges.
  • SimpleGraphFromIterator(edgelist)
  • SimpleGraph(adjmx::AbstractMatrix)
  • SimpleGraph{T}(g::AbstractGraph)
  • SimpleGraph(edge_list::Vector{SimpleGraphEdge{T}})
Goals for 2.0

We will have a new concrete graph type Graph{V} which can represent arbitrary vertices.
We would need new constructors to be able to construct such new graphs.

Instead of passing nv, we should provide a list (or even an iterator ?) of the vertices of the graph.

As the type of vertices can be arbitrary, the type signatures of generators can quickly become a mess / incompatible

Also we will need to support multigraphs

My proposal
  • Graph{V}() and Graph(::Type{V})should be unambiguous
  • Remove SimpleGraph{T}(nv::Integer, ne::Integer) (much better to call explicitly erdos-renyi)
  • I don't really get this one SimpleGraph(nv::Integer, ne::Integer, edgestream::Channel), I think It does not add much to SimpleGraphFromIterator
  • Keep Graph{T<:Integer}(nv::Integer)
  • Use keywords for other generators:
    • Graph{V<:Integer}(adjmx=adjmx)
    • (Multi)Graph{V}(edge_list=edge_list)
    • (Multi)Graph{V}(vertices=vertices)
    • (Multi)Graph{V}(vertices=vertices::Vector{V})
    • Graph{V}(vertices=vertices::Vector{V}, adjmx=adjmx)
    • (Multi)Graph{V}(vertices=vertices::Vector{V}, edge_list=edge_list)

Is this proposal sound?
Do you have some other ideas of generators? A better proposal?

主要言語
Julia
スター
11
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaGraphs/GraphsBase.jl のほかの issue

JuliaGraphs/GraphsBase.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。