Skip to content

Graph-CADアプローチによる間取りグラフ→YAML変換パイプラインの実装 - #1

Open
4kk11 wants to merge 2 commits into
mainfrom
claude/graph-to-yaml-pipeline
Open

Graph-CADアプローチによる間取りグラフ→YAML変換パイプラインの実装#1
4kk11 wants to merge 2 commits into
mainfrom
claude/graph-to-yaml-pipeline

Conversation

@4kk11

@4kk11 4kk11 commented Apr 5, 2026

Copy link
Copy Markdown
Owner

Background

  • Graph-CAD (ICLR 2026) の「階層分解グラフによる段階的生成」アプローチをarchilangのLLM統合(Tier 3)に適用
  • LLMに直接YAML座標を書かせるのではなく、構造的中間表現(間取りグラフ)を経由することで生成精度と制約充足率を向上させる
  • archilangが既に持つバリデーション(13ルール)・inspect隣接グラフを活かした設計

Summary

  • 計画ドキュメント: docs/plan-graph-cad-integration.md — 4フェーズ計画(スキーマ定義→graph-to-yaml→LLMプロンプト→評価)
  • FloorplanGraphスキーマ (src/graph/types.ts): ゾーン・部屋ノード・接続エッジ・配置制約の中間グラフ型定義
  • graph-to-yamlパイプライン (6モジュール, ~1,300行):
    • room-sizer.ts: 畳数→グリッドサイズ変換
    • zone-placer.ts: ゾーン帯の方位配置(帯間接続考慮のBFS順序付け)
    • grid-packer.ts: 2行制約付き矩形パッキング
    • opening-placer.ts: 接続エッジ→ドア/窓/設備の自動生成
    • graph-to-yaml.ts: メインパイプライン + YAMLシリアライザ
  • CLIコマンド (generate): グラフJSON→YAML→validate→SVG
  • LLMプロンプトテンプレート: generate --prompt で表示
  • テスト: 9テスト追加(既存188含め全パス)
  • サンプル: 3LDKグラフJSON + 生成YAML

claude added 2 commits April 4, 2026 11:54
Plan to apply Graph-CAD's hierarchical graph intermediate representation
approach to archilang's Tier 3 (LLM integration). Defines a 4-phase
strategy: graph schema, graph-to-yaml engine, LLM prompt design, and
evaluation framework.

https://claude.ai/code/session_017rppwCngGYq9Q2C9Hqypbm
Add intermediate graph representation for LLM-based floor plan generation,
inspired by Graph-CAD (ICLR 2026). The pipeline converts a FloorplanGraph
JSON (rooms, connections, constraints) into valid archilang YAML.

New modules:
- src/graph/types.ts: FloorplanGraph schema (zones, rooms, connections, constraints)
- src/graph/room-sizer.ts: tatami → grid size conversion
- src/graph/zone-placer.ts: zone ordering with cross-band connection awareness
- src/graph/grid-packer.ts: 2-row constraint-based rectangle packing
- src/graph/opening-placer.ts: connection edges → openings/equipment specs
- src/graph/graph-to-yaml.ts: main conversion pipeline + YAML serializer

CLI:
- `generate` command: graph.json → YAML → validate → render
- `generate --prompt`: outputs LLM prompt template for graph generation
- `generate --render`: also produces SVG output

Tests: 9 new tests (all 188 pass)

https://claude.ai/code/session_017rppwCngGYq9Q2C9Hqypbm
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