1. Introduction

Download Report

Transcript 1. Introduction

表インターフェースのための
属性付きグラフとアルゴリズム
Attribute Graphs and Their Algorithms
for Table Interface
○本橋友江 (早稲田大学)
土田賢省 (東洋大学)
夜久竹夫 (日本大学)
WAAP 110 May.11th, 2002
1
1. Introduction
Position and Scope
Data Processing
Number
Character Strings
Picture : Tables, Charts, Graphs,
Pictures
Scope
Tables in Spread Sheet or Word
Editing, Drawing, Calculation
2
Background
Effectiveness of Table Processing
depends on Representation
Methods of Table.
Known Representation Methods
Quad-Tree Representation
For Search Algorithm
Rectangular Dual Graph
Representation
For Plant Layout
3
Problems
In present table processing systems,
Editing operation often cause
unexpected results.
We do not know which
Representation Methods is applied.
Quad-tree Rep. and Rectangular
Dual Graph Rep. are not for table
editing and drawing.
4
Example(unexpected results)
1
*
1
2
2
*
3
*
3
4
*
4
2を指定
列挿入
5
Our History
Tree structured diagrams
Attributed marked trees
Combinatorial drawing
algorithms
Modular forms
Attributed marked trees
6
Our Purpose
1. To propose Graph
Representation Methods for
tables in consideration of editing
and drawing.
2. To investigate mathematical
properties of the graphs in the
representation methods.
3. To introduce typical algorithms
on graphs and evaluate their
complexity.
7
Our Results
1. A Graph representation method is
proposed.
2. Properties of the graph is shown
|nodes|in the graph
= |cells| in the table.
The degrees of nodes ≦ 8.
3. Algorithms for Wall move and
Column Insertion are introduced,
and runs in linear time.
8
Representation Method of tables
Quad-Tree Representation
(for search)
NE
NW
SW
SE
9
Rectangular Dual Graph
Representation
(for プラントレイアウト)
1
3
N
2
4
2
1
6
W
3
4
5
E
6
5
Horizontal edge
Vertical edge
S
10
2. Tabular Diagrams
Definitions.
An (n, m)-table T is a set
{(i, j) | 1≦i ≦n, 1 ≦ j ≦ m}
(1,1)
(2,1)
(1,2)
(2,2)
(1,3)
(2,3)
(2,3)-table T
11
Definitions. For an (n,m)-table T,
A partial table S is a subset of T
s.t. S = {(i, j) | k ≦ i ≦ l, s ≦ j ≦ t},
1 ≦ k ≦ l ≦n, 1 ≦ s ≦ t ≦m
A partition P {S1,S2,…,SN}
is the set of partial tables
s.t. S1∪S2∪…∪SN=T, Si∩Sj=φ
cell
{(1,1),
(2,1)}
{(1,2)} {(1,3)}
{(2,2), (2,3)}
partition P2 over T
12
Definitions. For an (n, m)-table T,
Row grid gr:{0, 1, 2, ..., n} →R 増
Column grid gc
Grid g is a pair g=(gr, gc)
A Tabular Diagram D= (T, P, g).
0
1
2
0
2
3
6
Tabular diagram D2=(T,P2,g2)
13
Definitions. For a cell
c={(i, j) | k ≦ i ≦ l, s ≦ j ≦ t},
north wall nw(c)=gr(k-1)
south wall, east wall, west wall
0
1
2
0
2
3
6
c
nw(c)=1 sw(c)=2
ew(c)=6 ww(c)=2
14
Condition*.
For a tabular diagram D=(T,P,G),
1. T is a (n,m)-table, where n,m≧3.
2. P has perimeter cells
with width=0 or height=0
0
0
1
2
2
0 0
*
*
*
*
3
2
66
*
*
*
*
*
*
Perimeter cells
*
*
*
*
15
Examples.
0
0
1
2
2
0 0
0
1
2
2
0
2
3
6
D2=(T,P2,g2)
3
66
* *
*
*
*
*
*
*
*
* *
*
*
*
D2*=(T*,P2*,g2*) satisfying Condition*
We consider tabular diagrams
satisfying Condition*.
16
3. Graph Representation
of Tables
Operations on Editing Tables
Wall moving
Insertion/deletion/unification
of Row/column/cell
Requirements
computational complexity
Suitable correspondence
17
Definitions.
An attribute graph is a 6-tuple
G=(V,E,L,λ,A,α), where
(V,E) : multi edge graph
L : label set for edges
λ : E→L is the label function
A is the set of attribute
α : V→A is the attribute map
18
Graph representation of tables
A Tabular Diagram D=(T,P,g) is
represented as an attribute
graph GD=(VD,ED,L,λD,A,αD)
VD is identified by a partition P
node⇔cell.
We denote a node vc for the
cell c,
19
L={enw,esw,eew,eww},
Equal north wall, equal south
wall, …
A = R4,
αD : VD →R4 are defined for vc by
αD(vc)=
(nw(c),sw(c),ew(c),ww(c)).
20
ED and λD : ED→L are defined
by the Rules,
Rule N If cells c and d have the
equal north wall, i.e.
nw(c)=nw(d),
and there is not such a cell
between them,
then an edge [vc, vd] is in ED,
21
λD [vc,vd] = enw. (equal north wall)
The edge [vc,vd] is called a
north wall edge.
Rule S Rule E Rule W も同様
North
South Wall
wall edge
Edge
East Wall
Edge
West Wall
Edge
22
Examples.
a
a
va
vd
d
c
d
c
vc
An attribute graph is called a
tessellation graph, if it
represents a tabular diagram.
23
Properties
Let GD be tessellation graph for
a tabular diagram D of an
(n,m)-table.
Proposition 3.1
Number of nodes in GD
= number of cells in D
24
Proposition 3.2
2|ED|
= 6(2n-4) + 6(2m-4) + 8k + 16.
Where k is the number of
non perimeter cells.
The degree of node in GD
is at most 8.
25
4.Algorithms
MOVEEASTWALL
Moved Wall
δ
c
c
D
E
Input
Output
GD=(VD,ED,L,λD,A,αD)
GE=(VE,EE,L,λE,A,αE)
Vc: a node
δ≧0 : movement value
26
Node vc から East wall edge 隣の列を
West wall edge
East wall edge をたどりながら
をたどりながら
を上にたどる
East Wall 変更
West Wall 変更
27
INSERTCOLUMN
Inserted Column
c
D
Input
GD, Vc : a node
E
*
*
*
*
*
*
Output
GE
28
*
*
*
*
*
*
新しい列以東
Wall Move
East
を行う
West wall edge
Node vc から
West wall edge をたどりながら、
1node ずつ追加
を上にたどる
Edgeの更新
29
For a tabular diagram D of
(n,m)-table,
Theorem4.1
Algorithm MOVEEASTWALL
runs in O(n) time.
30
Theorem 4.2
Algorithm INSERTCOLUMN
runs in O(nm) time.
Remark
Algorithm INSERTCOLUMN
visits only nodes which
needs to change attributes.
31
5. Conclusion
summary
1. An attribute Graph rep. method is
proposed.
2. Properties of the graph is shown
|nodes|in the graph
= |cells| in the table.
The degrees of nodes ≦ 8.
3. Algorithms for Wall move and
Column Insertion runs in linear
time.
32
Future Works
XML Viewer for tessellation graph.
Other Algorithms for Editing
Commands
Practical Processing Systems
Graph Grammars for generate
tessellation graphs
Conditions of tessellation graph
33
34
East wall and west wall coordinates are
same of x and y
West wall coordinates are same of x
and y
East wall coordinates are same
of x and y
35
Representation of table by tessellation
graphs (continued)
Peripheral cells and corresponding nodes
Cell a is represented by node
Ceiling of the cell a is represented by node z
Virtual cells x and y has no valid heights
Ceiling of the cell z is covered by cells x and y
36
example
x
y
a
z
37
General rules
x
y
x
x
y
y
Cells x and y are of same ceiling coordinates
Cells x and y are of same floor coordinates
Cells x and y are of same ceiling and floor
coordinates
38
Tables and tessellation graphs(3)
A large inner cell and corresponding
nodes
The cell a is represented by the node x.
x
a
39
y
x
North wall and south wall
coordinates are same of x and y
North wall coordinates are same
of x and y
south wall coordinates are same
of x and y
40
East wall and west wall coordinates are
same of x and y
East wall coordinates are same of x and
y
West wall coordinates are same
of x and y
41
4. CONCLUSION
Future Works
Other Methods
Relation to Mathematical Theory
Graph Grammars
42
2. Known Results
図表
昔から重要な視覚的な情報媒介
コンピュータの分野でも欠かせない情報の伝達手
段、思考ツール
表:様々な分野で、数多く考案・開発
相関表 生活行為相関表、リーグ戦表、九九表
行列表 生命表、曜日表、履修科目一覧表、万年暦
三角・多角表 要因分析表、P型相関表(五角形)
配列 魔方陣、掛け算表(インド)、碁盤、ダイヤモンド・ゲーム
(
「図の体系」 出原他、日科技連より)
43
2. Known Results
表計算ソフト
利用目的
データ処理としての計算
表形式の分かり易い資料作成
多数開発
データ処理として、EXCELやLotus
資料作成として、Wordの表作成機能
Gridy、Noel、SpreadCE、GS-Calc v5.0、・・・
44
1. Introduction
対象:資料作成のための表作成機能
主流:Word の表作成機能
問題点
表計算ソフトでは、編集結果の
予測がつかないことが起こる
対象と操作に対応するデータ構造とその変換
結果が明示されない
利用者が思考錯誤して推測している
45
1. Introduction
本研究の目標
表に必要なデータをまとめ、形式的に定義
表データに、属性付きグラフの構造を持た
せる手法の提案
表の編集操作のアルゴリズムをいくつか作
成し、計算時間を評価
46
1. Introduction
本研究の目的
編集・描画を考慮した、表のデータ構造を
提案
表を属性付きグラフを用いてあらわす手法
の提案
表の編集操作のアルゴリズムをいくつか作
成し、計算時間を評価
47
Example 1. The following figure
denotes a support partition {{(1,1),
(2,1)}, {(1, 2)}, {(1, 3)}, {(2, 2), (2,
3)}} over (2, 3)-support.
48
Example 2.
49
Applications of Tables
計算幾何学、プラントレイアウト、
回路設計、結晶群と離散構造、
ソフトウェア工学(仕様書、表エディタ)
50
Application of Our Results
Our concept may be applied to
general table document
processing in common spread
sheet systems or common
document processor.
51
Expectation of Our Results
Viewer
Other algorithms
Practical processing systems
Graph grammars for generate
our graphs
52
Example
1
2
3
4
1
2を指定
列挿入
2
3
4
53
Example.
Tabular diagram D2=(T,P2,g2)
0
1
2
0
2
3
6
c
nw(c)=1 sw(c)=2
ew(c)=6 ww(c)=2
height(c)=1
width(c)=4
54
Condition*(続き).
2. P has perimeter cells of the
form {(k,s)} satisfying one of
k=1 s∈{1,2,…,m}.
k=n s∈{1,2,…,m}.
k∈{1,2,…,n} s=1.
k∈{1,2,…,n} s=m.
For a perimeter cell c={(k,s)},
width(c)=0 if s∈{1,m}.
height(c)=0 if k∈{1,n}.
55