partitioning graphs of supply and demand generalization of knapsack problem takao nishizeki tohoku...

116
Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Upload: amberlynn-ross

Post on 04-Jan-2016

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Partitioning Graphs

of Supply and Demand

Generalization of Knapsack Problem

Takao Nishizeki

Tohoku UniversityTohoku University

Page 2: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Graph

Supply Vertices Demand Vertices

Supply Vertices and Demand Vertices

Page 3: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Graph

4

6 5 3 5

4

26 107

8

12

15 13

25

Each Supply Vertex has a number, called Supply.Each Supply Vertex has a number, called Supply.

Each Demand Vertex has a number, called DemandEach Demand Vertex has a number, called Demand

SupplySupply

DemandDemand

Supply Vertices Demand Vertices

Page 4: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Desired Partitionpartition G into connected components so that

4

6 5 3 5

4

26 107

8

12

15 13

58 6

425

Page 5: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Desired Partitionpartition G into connected components so that

4

6 5 3 5

4

26 107

8

12

15 13

25

Page 6: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Desired Partition partition G into connected components so that

(a) each component has exactly one supply vertex,(b) supply is no less than the sum of demands in

the component.

(a) each component has exactly one supply vertex,(b) supply is no less than the sum of demands in

the component.

4

6 5 3 5

4

26 107

8

12

15 13

25 4

6 5 3 5

4

26 107

8

Desired partitionDesired partition

Sum :

23Su

m :13

Sum :12

Sum :12

Page 7: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Maximum Partition Problem (Max PP)

4

6 5 3 5

4

26 107

8

10

15 13

20

No desired partitionNo desired partition

Page 8: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

4

6 5 3 5

4

26 107

8

10

15 13

20

(a) each component has exactly one supply vertex,(b) supply is no less than the sum of demands in

the component.

(a) each component has exactly one supply vertex,(b) supply is no less than the sum of demands in

the component.

A partition of a graph must satisfy

4

6 5 3 5

4

26 107

8

no supply vertex no supply vertex

Maximum Partition Problem (Max PP)

(a) each component has at most one supply vertex,(b) supply is no less than the sum of demands in

the component.

(a) each component has at most one supply vertex,(b) supply is no less than the sum of demands in

the component.

Page 9: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(a) each component has at most one supply vertex,(b) supply is no less than the sum of demands in

the component.

(a) each component has at most one supply vertex,(b) supply is no less than the sum of demands in

the component.

4

6 5 3 5

4

26 107

8

10

15 13

20 4

6 5 3 5

4

26 107

8

finds a partition that maximizes the “fulfillment.”

Sum :

17

Sum :

7

Sum : 5

Sum :12

Maximum Partition Problem (Max PP)

(a) each component has at most one supply vertex,(b) supply is no less than the sum of demands in

the component if there is a supply vertex.

(a) each component has at most one supply vertex,(b) supply is no less than the sum of demands in

the component if there is a supply vertex.

A partition of a graph must satisfy sum of demands in all components

with supply vertices

Page 10: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

finds a partition that maximizes the “fulfillment.”

The fulfillment of this partition17 + 5 + 12 + 7 = 41

The fulfillment of this partition17 + 5 + 12 + 7 = 41

4

6 5 3 5

4

26 107

8

10

15 13

20 4

6 5 3 5

4

26 107

8

Maximum Partition Problem (Max PP)

Sum :

17

Sum :

7

Sum : 5

Sum :12

Page 11: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Sum :

19

Sum :

15

Sum : 8

Sum :12

4

6 5 3 5

4

26 107

8

10

15 13

20

finds a partition that maximizes the “fulfillment.”

6

4

6 5 3 5

4

2 107

8

The fulfillment of this partition19 + 8 + 12 + 15 = 54

The fulfillment of this partition19 + 8 + 12 + 15 = 54

Maximum fulfillment

Maximum Partition Problem (Max PP)

Page 12: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Complexity Status

7

4 3 6

2 3 9 4

5 15

25TreesTrees

NP-hard

Maximum Subset Sum Problem (NP-hard)instance: a set A of integers and an integer bfind: a subset C ⊆ A which maximizes the sum of integers in C s.t. the sum does not exceed b.

Maximum Subset Sum Problem (NP-hard)instance: a set A of integers and an integer bfind: a subset C ⊆ A which maximizes the sum of integers in C s.t. the sum does not exceed b.

3 4 5 7 11

b = 13

max subset sum problem(simple ver. of Knapsack)

given set A

Page 13: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

C

Complexity Status

TreesTrees

NP-hard

Maximum Subset Sum Problem (NP-hard)instance: a set A of integers and an integer bfind: a subset C ⊆ A which maximizes the sum of integers in C s.t. the sum does not exceed b.

Maximum Subset Sum Problem (NP-hard)instance: a set A of integers and an integer bfind: a subset C ⊆ A which maximizes the sum of integers in C s.t. the sum does not exceed b.

7

4 3 6

2 3 9 4

5 15

25

3 4 5 7 11

b = 13

max subset sum problem(simple ver. of Knapsack)

given set A

Page 14: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Related Result

Max PP for Starswith one supply at center

Fully Polynomial-Time Approximation Scheme(FPTAS)

[Ibarra and Kim ’75]

FPTAS: for any , 0 < < 1, the algorithm finds an approximation solution such that

APPRO > (1–) OPTin time polynomial in both n and 1/.

FPTAS: for any , 0 < < 1, the algorithm finds an approximation solution such that

APPRO > (1–) OPTin time polynomial in both n and 1/.

max subset sum problem (NP-hard)max subset sum problem (NP-hard)

3 4 5 7 11

13

Page 15: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Related Result

Max PP for Starswith one supply at center

Fully Polynomial-Time Approximation Scheme(FPTAS)

[Ibarra and Kim ’75]

max subset sum problem (NP-hard)max subset sum problem (NP-hard)

3 4 5 7 11

13

good approximationfor larger classesgood approximationfor larger classes??

7

4 3 6

2 3 9 4

5

15

25

4

6 5 3 5

4

26 107

8

12

15 13

25

Page 16: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Our Results (approximabiliy)

4

6 5 3 5

4

26 107

8

12

15 13

25

General graphs (1) MAXSNP-hard (APX-hard)

No PTAS unless P=NPNo PTAS unless P=NP

PTAS: for any , 0 < < 1, the algorithm finds an approximation solution such that

APPRO > (1–) OPTin time polynomial in n. (1/:regarded as a constant.)

PTAS: for any , 0 < < 1, the algorithm finds an approximation solution such that

APPRO > (1–) OPTin time polynomial in n. (1/:regarded as a constant.)

No FPTAS unless P=NPNo FPTAS unless P=NP

Page 17: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Our Results (approximabiliy)

4

6 5 3 5

4

26 107

8

12

15 13

25

General graphs

Trees

(2) FPTAS

(1) MAXSNP-hard (APX-hard)

No PTAS unless P=NPNo PTAS unless P=NP

NP-hard

7

4 3 6

2 3 9 4

5 15

25

Page 18: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Our Results (approximabiliy)

4

6 5 3 5

4

26 107

8

12

15 13

25

General graphs

(2) FPTAS

(1) MAXSNP-hard (APX-hard)

No PTAS unless P=NPNo PTAS unless P=NP

Trees NP-hard

7

4 3 6

2 3 9 4

5 15

25

Page 19: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardnessMax PP is MAXSNP-hard for bipartite graphs.

L-reduction: preserves approximability

L-reductionMax PP for

bipartite graphs

4 4

7

4 4

7

4 4

7

1 1 1

3-occurrence MAX3SAT

each variable appears at most 3 times

zyxzyxzyxf

error ratio: error ratio: ’

Page 20: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness3-occurrence MAX3SAT (MAXSNP-hard)

instance: variables and clauses s.t. • each clause has exactly 3 literals; and • each variable appears at most 3 times in the clausesfind: a truth assignment which maximizes # of satisfied clauses

variables: v w x y z

zyxzwvzxwywvf

at most 3 times

Page 21: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness

instance: variables and clauses s.t. • each clause has exactly 3 literals; and • each variable appears at most 3 times in the clausesfind: a truth assignment which maximizes # of satisfied clauses

variables: v w x y z

zyxzwvzxwywvf

at most 3 times

3-occurrence MAX3SAT (MAXSNP-hard)

Page 22: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness

instance: variables and clauses s.t. • each clause has exactly 3 literals; and • each variable appears at most 3 times in the clausesfind: a truth assignment which maximizes # of satisfied clauses

variables: v w x y z

zyxzwvzxwywvf

3-occurrence MAX3SAT (MAXSNP-hard)

Page 23: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardnessvariable gadgetvariable gadget

4 4

7

x x

variable x

4 4

7

x x

x = false

4 4

7

x x

x = true

4+4 = 8 > 7

Page 24: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness

1 1 1

4 4

7x x

4 4

7y y

4 4

7z z

zyxzyxzyxf

variable x variable y variable z

Page 25: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness

1 1 1

4 4

7x x

4 4

7y y

4 4

7z z

zyxzyxzyxf

variable x variable y variable z

Page 26: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness

1 1 1

4 4

7x x

4 4

7y y

4 4

7z z

zyxzyxzyxf

variable x variable y variable z

Page 27: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness

4 4

7

4 4

7

4 4

7

1 1 1

x x y y z z

zyxzyxzyxf

variable x variable y variable z

at most 3

7 – 4 = 3enough power

Page 28: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness

4 4

7

4 4

7

4 4

7

1 1 1

x x y y z z

zyxzyxzyxf

variable x variable y variable z

Page 29: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness

4 4

7

4 4

7

4 4

7

1 1 1

x x y y z z

x = true y = false z = false

zyxzyxzyxf

Page 30: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness

4 4

7

4 4

7

4 4

7

1 1 1

x x y y z z

zyxzyxzyxf

variable x variable y variable z

Page 31: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardness

4 4

7

4 4

7

4 4

7

1 1 1

x x y y z z

zyxzyxzyxf

x = false y = false z = false

not satisfied

Page 32: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(1) MAXSNP-hardnessMax PP is MAXSNP-hard for bipartite graphs.

L-reduction: preserves approximability

3-occurrence MAX3SAT

Max PP for bipartite graphs

L-reduction

4 4

7

4 4

7

4 4

7

1 1 1

each variable appears at most 3 times

zyxzyxzyxf

Page 33: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Our Results (approximabiliy)

4

6 5 3 5

4

26 107

8

12

15 13

25

General graphs

(2) FPTAS

(1) MAXSNP-hard (APX-hard)

No PTAS unless P=NPNo PTAS unless P=NP

Trees NP-hard

Pseudo-poly.-time algorithm

7

4 3 6

2 3 9 4

5 15

25

Page 34: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

7

4 3 6

2 3 9 4

5 15

25

Max PP is NP-hard even for trees.

Max PP can be solved for a tree T in time O(F 2n)

if the supplies and demands are integers.

Max PP can be solved for a tree T in time O(F 2n)

if the supplies and demands are integers.

2+3+4+ ・・・ +4+5= 43

15+25= 40

F= min{43,40}=40

max fulfillment ≦ Fmax fulfillment ≦ F

• sum of all demands• sum of all supplies

F = min

Pseudo-Polynomial-Time Algorithm

Page 35: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

15 20

8 2 7 5

43 35

4 3 6 9

2 7 2 420 25

rootroot

rootroot3

20

4 7 7

2 8 2 4 3 6

5 2 3 9 4

515

20

25

Dynamic ProgrammingDynamic Programming

Pseudo-Polynomial-Time Algorithm

Page 36: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

5

9Tv

5

9

3520

10 Tv

3

9v

5

5

10

20

v

3520

10

optimal partition of Tv optimal partition of T

520

5

10

3

9

T

fulfillment = 18 fulfillment = 20

Pseudo-Polynomial-Time Algorithm

Page 37: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Tv

5

9

5

9

3520

10v

520

10

3

fulfillment: 10

5

9Tv

5

9

3520

10v

3520

10

fulfillment: 18

Dynamic ProgrammingDynamic Programming

20 - (10+5+3) = 2marginal power

1020-10=

Pseudo-Polynomial-Time Algorithm

Page 38: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

5

9Tv

5

9

3520

10v

520

10

3

fulfillment: 15

Tv

5

9

5

9

3520

10v

3520

10

20-(10+3)= 7

fulfillment: 13

20-(10+5)=5

Dynamic ProgrammingDynamic Programming

Pseudo-Polynomial-Time Algorithm

Page 39: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

5

9Tv

5

9

3520

10v

520

10

3

fulfillment: 15

Tv

5

9

5

9

3520

10v

3520

10

7

fulfillment: 13

5

Tv

5

9

5

9

3520

10v

520

10

3

fulfillment: 10

5

9Tv

5

9

3520

10v

3520

10

2

fulfillment: 18

10

Tv

3

9v

5

5

10

20

optimal partition of T

520

5

10

3

9

Pseudo-Polynomial-Time Algorithm

Page 40: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

123

marginal power

0

F1 2 3 fulfillment

5

9Tv

5

9

3520

10v

520

10

3

fulfillment: 15

Tv

5

9

5

9

3520

10v

3520

10

7

fulfillment: 13

5

Tv

5

9

5

9

3520

10v

520

10

3

fulfillment: 10

5

9Tv

5

9

3520

10v

3520

10

2

fulfillment: 18

10

staircase,non-increasingstaircase,non-increasing

Pseudo-Polynomial-Time Algorithm

F points

Page 41: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Tv 15v

5

4

5

53

optimal partition of T

Tv 15v

5

4

5

53

Tv 15v

5

53

5

4

fulfillment: 9

5+4 = 9deficient power

Pseudo-Polynomial-Time Algorithm

Page 42: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

T

v

15v

5

53

5

4

fulfillment: 8

8

T

v

15v

5

5

fulfillment: 12

12

3

5

4

T

v

15v

5

53

5

4

fulfillment: 9

9

T

v

15v

5

53

fulfillment: 5

5

5

4Tv 15v

5

4

5

53

optimal partition of T

Tv 15v

5

4

5

53

Pseudo-Polynomial-Time Algorithm

Page 43: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

T

v

15v

5

53

5

4

fulfillment: 8

8

T

v

15v

5

5

fulfillment: 12

12

3

5

4

T

v

15v

5

53

5

4

fulfillment: 9

9

T

v

15v

5

53

fulfillment: 5

5

5

4

123

deficient power

0

F1 2 3 fulfillment

staircase, non-decreasingstaircase, non-decreasing

Pseudo-Polynomial-Time Algorithm

F points

Page 44: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

3

20

4 7 7

2 8 2 4 3 6

5 2 3 9 4

515

20

25leaves

Pseudo-Polynomial-Time Algorithm

Page 45: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

3

20

4 7 7

2 8 2 4 3 6

5 2 3 9 4

515

20

25

3

20

4 7 7

2 8 2 4 3 6

5 2 3 9 4

515

20

25marginal power

0

F12 3 fulfillment

deficient power

0

F123 fulfillment

deficient power

0

F123 fulfillment

marginal power

0

F12 3 fulfillment

O(F 2) time

marginal power

0

F1 2 3 fulfillment

deficient power

0

F123 fulfillment

Page 46: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

rootroot3

20

4 7 7

2 8 2 4 3 6

5 2 3 9 4

515

20

25

Dynamic Programming

Dynamic Programming

marginal power

0

F1 2 3 fulfillment

deficient power

0

F1 2 3 fulfillment

max fulfillment

Pseudo-Polynomial-Time Algorithm

Page 47: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

rootroot3

20

4 7 7

2 8 2 4 3 6

5 2 3 9 4

515

20

25

Computation timeComputation time

for each vertex ・・・・・・・・・・・・・・ O(F 2)

Dynamic Programming

Dynamic Programming

There are n vertices.

Pseudo-Polynomial-Time Algorithm

Page 48: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Computation timeO(F

2n)Computation time

O(F 2n)

The algorithm takes polynomial time if F is bounded by a polynomial in n.The algorithm takes polynomial time if F is bounded by a polynomial in n.

There are n vertices.

Computation timeComputation time

for each vertex ・・・・・・・・・・・・・・ O(F 2)

Pseudo-Polynomial-Time Algorithm

Page 49: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(2) FPTAS

For any , 0< <1, the algorithm finds a partition of a tree T such that

OPT – APPRO < OPT

in time polynomial in both n and 1/ .

For any , 0< <1, the algorithm finds a partition of a tree T such that

OPT – APPRO < OPT

in time polynomial in both n and 1/ .

Let all demands and supply be positive real numbers.

2

5

n

O

n : # of vertices

Page 50: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

The algorithm is similar to the previous algorithm.

0fulfillment

marginal power

t sampled fulfillment

(2) FPTAS

Page 51: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

0fulfillment

marginal power

t

The algorithm is similar to the previous algorithm.

(2) FPTAS

OPT – APPRO < 2nt

total error < error/merge × # of merge

< 2t × n

sampled fulfillment

OPTOPT

APPROAPPRO

Page 52: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

ErrorError md: max demand

7

4 3 6

2 3 9 4

5

15

25

9

md = 9

(2) FPTAS

n

mt d

2

OPT – APPRO < 2nt

Page 53: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

ErrorError md: max demand

(2) FPTAS

OPT – APPRO < 2nt

dm md OPT≦ ≦ OPT

OPT – APPRO < OPTOPT – APPRO < OPT

error ratio

OPT

APPROOPT

n

mt d

2

Page 54: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

nt

FO

2

dd nmF

n

mt ,

2

md: max demand

Computation timeComputation time

2

5

n

O

marginal power

0 t Sampled fulfillment

pointst

F

(2) FPTASErrorError

OPT – APPRO < OPT

Page 55: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Conclusions

4

6 5 3 5

4

26 107

8

12

15 13

25

General graphs(1) MAXSNP-hard (APX-hard)

No PTAS unless P=NPNo PTAS unless P=NP

Trees

(2) FPTAS

NP-hard

7

4 3 6

2 3 9 4

5 15

25

Page 56: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Variant (Generalization of Knapsack Problem)

find a partition which maximizes sum of profits of all demand vertices that are supplied power.

10

3, 50 7, 30 8, 200

demand profit

Page 57: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Variant (Generalization of Knapsack Problem)

10

3, 50 7, 30 8, 200

demands = 3+7 = 10

profits = 50+30 = 80

SumSum

10

3, 50 7, 30 8, 200

demands = 8

profits = 200

SumSum

max

find a partition which maximizes sum of profits of all demand vertices that are supplied power.

Page 58: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Variant (Generalization of Knapsack Problem)

find a partition which maximizes sum of profits of all demand vertices that are supplied power.

FPTAS for KP [Ibarra and Kim ’75]

FPTAS for trees

7, 30 5, 45

10

8, 20

6, 12

2, 10

15

10

3, 50 7, 30 8, 200

Page 59: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Variant (Generalization of Knapsack Problem)

find a partition which maximizes sum of profits of all demand vertices that are supplied power.

FPTAS for KP [Ibarra and Kim ’75]

FPTAS for trees

7, 30 5, 45

10

8, 20

6, 12

2, 10

15

extendable to partial k-trees(graphs with bounded treewidth) if there is exactly one supply

20

7, 8 5, 25

8, 3

6, 12

2, 10

3, 5 8, 13

10

3, 50 7, 30 8, 200

Page 60: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Variant (Generalization of Knapsack Problem)

find a partition which maximizes sum of profits of all demand vertices that are supplied power.

FPTAS for KP [Ibarra and Kim ’75]

FPTAS for trees

7, 30 5, 45

10

8, 20

6, 12

2, 10

15

extendable to partial k-trees(graphs with bounded treewidth) if there is exactly one supply

10

3, 50 7, 30 8, 200

20

7, 8 5, 25

8, 3

6, 12

2, 10

3, 5 8, 13

Page 61: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Thank You!Thank You!

Page 62: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University
Page 63: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(2b) Parallel connection

G 1

:terminal

Series-Parallel Graphs (recursively)(1) A single edge is a SP graph.

(2a) Series connection

G2

G 1

G2

G 1

G2

G 1

G2

Page 64: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

e1

e2

e3

e6e4

e5

e7

:terminal

SP Graph & Decomposition Tree

P

S

S P

SS

e1 e2 e3 e4 e5 e6 e7

leavesDecomposition tree

Page 65: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

e1 e2 e3 e4 e5 e6 e7

leavesDecomposition tree

e1

e2

e3

e6

e4

e5

e7

SP Graph & Decomposition Tree

:terminal

Page 66: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

e1 e2 e3 e4 e5 e6 e7

leavesDecomposition tree

e1

e2

e3

e6

e4

e5

e7

SP Graph & Decomposition Tree

:terminal

Series connection

S

Page 67: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

e1

e2

e3

e6

e4

e5

e7 SS

:terminal

Series connectione1 e2 e3 e4 e5 e6 e7

leavesDecomposition tree

SP Graph & Decomposition Tree

Page 68: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

e1

e2

e3

e6

e4

e5

e7

P

SS

:terminal

Parallel connection

SP Graph & Decomposition Tree

e1 e2 e3 e4 e5 e6 e7

leavesDecomposition tree

Page 69: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

e1

e2

e3

e7

e6

e4

e5

S P

SS

:terminal

Series connection

SP Graph & Decomposition Tree

e1 e2 e3 e4 e5 e6 e7

leavesDecomposition tree

Page 70: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

e1

e2

e3

e7

e6

e4

e5

S

S P

SS

:terminal

Series connection

SP Graph & Decomposition Tree

e1 e2 e3 e4 e5 e6 e7

leavesDecomposition tree

Page 71: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

e1

e2

e3

e6e4

e5

e7

P

S

S P

SS

:terminal

Parallel connection

SP Graph & Decomposition Tree

e1 e2 e3 e4 e5 e6 e7

leavesDecomposition tree

Page 72: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

e1

e2

e3

e6e4

e5

e7

P

S

S P

SS

:terminal

SP Graph & Decomposition Tree

e1 e2 e3 e4 e5 e6 e7

leavesDecomposition tree

e1

e2

e3

e6e4

e5

e7

e6e4

e5

e7

e1

e2

e3

e6e4

e5

e7

Page 73: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

e1

e2

e3

e6e4

e5

e7

P

S

S P

SS

DP algorithmDP algorithm

:terminal

SP Graph & Decomposition Tree

e1 e2 e3 e4 e5 e6 e7

leavesDecomposition tree

Page 74: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time AlgorithmSuppose that a SP graph has exactly one supply.

Max PP for such a SP graph can be solved in time O(F 2n) if the demands and the supply are integers. Max PP for such a SP graph can be solved in time O(F 2n) if the demands and the supply are integers.

3 6

10

7

5

6

2

F : sum of all demands

F = 3+7+6+2+6+5 = 29

pseudo-polynomial-time algorithm

(2) FPTASmax fulfillment ≦ Fmax fulfillment ≦ F

n: # of vertices

Page 75: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Decomposition tree Corresponding SP subgraphs

G12

G1 G2

S

P

S

DP table

DP table

DP table

What should we store in the table for Max PP ?

1

3 2

4

7 1

3 2

3 2

4

7

5

5

Pseudo-Polynomial-Time Algorithm

Page 76: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

Page 77: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

Page 78: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

Page 79: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

Page 80: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

G

If G had more than one supply, Max PP would find a partition.

Page 81: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

G

Max PP finds only one component with the supply

Page 82: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

G

two terminals are supplied power and contained in same component

Page 83: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

G

Max PP finds only one component with the supply

Page 84: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

G

two terminals will be supplied power, but are contained in different components

Page 85: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

G

Max PP finds only one component with the supply

Page 86: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

G

this terminal will be supplied power

this terminal is never supplied power

Page 87: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

G

Max PP finds only one component with the supply

Page 88: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

G

two terminals are never supplied power

Page 89: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithmboth are/will besupplied powerboth are/will besupplied power

one is/will be supplied, but the other is never suppliedone is/will be supplied, but the other is never supplied

both are never suppliedboth are never supplied

same component

different components

Page 90: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

If the component has the supply vertex, then the component may have the “marginal” power.

103 2

4

103 2

+3 2

4

Pseudo-Polynomial-Time Algorithm

Page 91: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

If the component has the supply vertex, then the component may have the “marginal” power.

marginal power

10 – (3+2) = 5

Pseudo-Polynomial-Time Algorithm

103 2

Page 92: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

If the component has no supply vertex, the component may have the “deficient” power.

3 27

+3 2

20

73 2

20

Pseudo-Polynomial-Time Algorithm

Page 93: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

If the component has no supply vertex, the component may have the “deficient” power.

deficient power

3+7+2 = 12

Pseudo-Polynomial-Time Algorithm

3 27

Page 94: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithmboth are/will besupplied powerboth are/will besupplied power

same component

one is/will be supplied, but the other is never suppliedone is/will be supplied, but the other is never supplied

both are never suppliedboth are never supplied

different components

Page 95: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithmboth are/will besupplied powerboth are/will besupplied power

0

F1 2 3 fulfillment

marginal power

fulfillment

123

marginal power

5

staircase,non-increasingstaircase,non-increasing

Page 96: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithmboth are/will besupplied powerboth are/will besupplied power

deficient power

fulfillment

123

deficient power

0

F1 2 3 fulfillment

staircase, non-decreasingstaircase, non-decreasing

Page 97: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithmboth are/will besupplied powerboth are/will besupplied power

same component

one is/will be supplied, but the other is never suppliedone is/will be supplied, but the other is never supplied

both are never suppliedboth are never supplied

different components

marginal power

0

F12 3 fulfillment

deficient power

0

F123 fulfillment

deficient power

0

F123 fulfillment

marginal power

0

F12 3 fulfillment

marginal power

0

F1 2 3 fulfillment

deficient power

0

F123 fulfillment

marginal power

0

F12 3 fulfillment

deficient power

0

F123 fulfillment

Page 98: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Decomposition tree Corresponding SP subgraphs

G12

G1 G2

S

P

S

DP table DP table

DP table

1

3 2

4

7 1

3 2

3 2

4

7

5

5

Pseudo-Polynomial-Time Algorithm

sizeO(F )

sizeO(F )

timeO(F

2)time

O(F 2)

Page 99: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time Algorithm

P

S

S P

SS

e1 e2 e3 e4 e5 e6 e7

Decomposition tree

O(F 2)O(F 2)

# of nodes = O(n)

O( F 2 n )O( F 2 n )

n : # of vertices in a given SP graph

Page 100: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Pseudo-Polynomial-Time AlgorithmSuppose that a SP graph has exactly one supply.

Max PP for such a SP graph can be solved in time O(F 2n) if the demands and the supply are integers. Max PP for such a SP graph can be solved in time O(F 2n) if the demands and the supply are integers.

3 6

10

7

5

6

2

F : sum of all demands

F = 3+7+6+2+6+5 = 29

pseudo-polynomial-time algorithm

(2) FPTASmax fulfillment ≦ Fmax fulfillment ≦ F

n: # of vertices

Page 101: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(2) FPTAS

For any , 0< <1, the algorithm finds a component with the supply vertex such that

APPRO > (1–) OPT

in time polynomial in both n and 1/ .

For any , 0< <1, the algorithm finds a component with the supply vertex such that

APPRO > (1–) OPT

in time polynomial in both n and 1/ .

Let all demands and supply be positive real numbers.

2

5

n

O

n : # of vertices

Page 102: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

(2) FPTAS

The algorithm is similar to the previous algorithm.

0fulfillment

marginal power

t sampled fulfillment

Page 103: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

0fulfillment

marginal power

t

(2) FPTAS

The algorithm is similar to the previous algorithm.

APPRO > (1–) OPT

md: max demand n

mt d

4

Page 104: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University
Page 105: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Open ProblemIs there an approximation algorithm for SP graphs having more than one supply?

• FPTAS or PTAS ?• constant-factor ?

3 2

52

8 6

3

Page 106: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Open Problemboth are/will besupplied powerboth are/will besupplied power

one is/will be supplied, but the other is never suppliedone is/will be supplied, but the other is never supplied

both are never suppliedboth are never supplied

same component

different components

Page 107: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Open Problemboth are/will be supplied powerboth are/will be supplied power

different componentsThe two components must become ONE component.

j k

deficient power= j + k

123

deficient power

0

F

1 2 3 fulfillment

j + k(1D)

Page 108: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Open Problem

j k

deficient power= j + k

If a given graph has more than one supply.

27

2

9 2

27

2

2 9

Page 109: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University
Page 110: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Our Results

3 6

10

7

5

6

2

Max subset sum problem

FPTAS [Ibarra and Kim, 1975]

Max PP

our FPTAS

straightforward ?

3 7

10

5 6 62

Page 111: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Our Results

3

10

7

5

6 6

2

Max subset sum problem

FPTAS [Ibarra and Kim, 1975]

Max PP

our FPTAS

straightforward ?

7

10

5 6 632

Sum: 10margin: 2

Sum: 8

The graph structure plays crucial role.The graph structure plays crucial role.

22

Page 112: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University
Page 113: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Every demand vertex must be supplied from exactly one supply vertex.

Assumption of the Problem

Max PP is applied to Power delivery networks.

It is difficult to synchronize two or more sources.

Page 114: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University
Page 115: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Power delivery network

Application of Max PPPower delivery problem

feeder

supply vertex=

load

demand vertex

= cable segment

edge

=

Page 116: Partitioning Graphs of Supply and Demand Generalization of Knapsack Problem Takao Nishizeki Tohoku University

Power delivery network

Power delivery problem

Determine whether there exists a switching so that all loads can be supplied.

If not all loads can be supplied, we want to maximize the sum of loads supplied power.

If not all loads can be supplied, we want to maximize the sum of loads supplied power.

Application of Max PP

Max Partition Problem