Struct PSP

Source
pub struct PSP { /* private fields */ }
Expand description

Project Selection Problem

§Problems

§References

§Verification

functionverify
penalty_if_red
penalty_if_blueARC085 #27489484
gain_if_red
gain_if_blueARC085 #27489484
penalty_if_red_blue
penalty_if_different
must_be_red
must_be_blue
if_red_then_must_be_redARC085 #27489484
gain_if_both_red
gain_if_both_blue

Implementations§

Source§

impl PSP

Source

pub fn new(size: usize) -> Self

PSPを生成する。

Source

pub fn penalty_if_red(&mut self, i: usize, c: u64)

頂点iがならばcの損失になる。

Source

pub fn penalty_if_blue(&mut self, i: usize, c: u64)

頂点iがならばcの損失になる。

Source

pub fn gain_if_red(&mut self, i: usize, c: u64)

頂点iがならばcの利益を得る。

Source

pub fn gain_if_blue(&mut self, i: usize, c: u64)

頂点iがならばcの利益を得る。

Source

pub fn penalty_if_red_blue(&mut self, i: usize, j: usize, c: u64)

頂点iがかつ頂点jがならばcの損失となる。

Source

pub fn penalty_if_different(&mut self, i: usize, j: usize, c: u64)

頂点iとjが異なる色ならばcの損失となる。

Source

pub fn must_be_red(&mut self, i: usize)

頂点iはでなければならない。

Source

pub fn must_be_blue(&mut self, i: usize)

頂点iはでなければならない。

Source

pub fn if_red_then_must_be_red(&mut self, i: usize, j: usize)

頂点iがならば、頂点jもでなければならない。

Source

pub fn gain_if_both_red(&mut self, i: usize, j: usize, c: u64)

頂点iとjがともにならばcの利益を得る。

Source

pub fn gain_if_both_blue(&mut self, i: usize, j: usize, c: u64)

頂点iとjがともにならばcの利益を得る。

Source

pub fn solve<F: MaxFlow<Cap = u64>>(self) -> Option<i64>

must be制約を破った場合、Noneを返す。そうでなければ、利益の最大値をSomeに包んで返す。

Trait Implementations§

Source§

impl Clone for PSP

Source§

fn clone(&self) -> PSP

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for PSP

§

impl RefUnwindSafe for PSP

§

impl Send for PSP

§

impl Sync for PSP

§

impl Unpin for PSP

§

impl UnwindSafe for PSP

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.